use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method removeAll_iterable.
@Test
public void removeAll_iterable() {
MutableLongCollection collection = this.classUnderTest();
Assert.assertFalse(collection.removeAll(this.newMutableCollectionWith()));
Assert.assertFalse(collection.removeAll(this.newMutableCollectionWith(-1L)));
Assert.assertEquals(this.newMutableCollectionWith(1L, 2L, 3L), collection);
Assert.assertTrue(collection.removeAll(this.newMutableCollectionWith(1L, 5L)));
Assert.assertEquals(this.newMutableCollectionWith(2L, 3L), collection);
MutableLongCollection collection1 = this.classUnderTest();
Assert.assertTrue(collection1.removeAll(this.newMutableCollectionWith(3L, 2L)));
Assert.assertEquals(this.newMutableCollectionWith(1L), collection1);
MutableLongCollection collection2 = this.newWith(0L, 1L, 1L, 2L, 2L, 2L, 3L);
Assert.assertFalse(collection2.removeAll(new LongArrayList()));
Assert.assertTrue(collection2.removeAll(LongArrayList.newListWith(0L, 1L)));
Assert.assertEquals(this.newMutableCollectionWith(2L, 2L, 2L, 3L), collection2);
Assert.assertFalse(collection2.removeAll(LongArrayList.newListWith(0L)));
Assert.assertTrue(collection2.removeAll(LongArrayList.newListWith(2L)));
Assert.assertEquals(this.newMutableCollectionWith(3L), collection2);
MutableLongCollection collection3 = this.newWith(0L, 1L, 1L, 2L, 2L, 2L);
Assert.assertTrue(collection3.removeAll(LongHashBag.newBagWith(0L, 1L, 1L)));
Assert.assertEquals(this.newMutableCollectionWith(2L, 2L, 2L), collection3);
}
use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method retainAll_iterable.
@Test
public void retainAll_iterable() {
MutableLongCollection collection = this.classUnderTest();
Assert.assertFalse(collection.retainAll(this.newMutableCollectionWith(1L, 2L, 3L)));
Assert.assertEquals(this.newMutableCollectionWith(1L, 2L, 3L), collection);
Assert.assertTrue(collection.retainAll(this.newMutableCollectionWith(1L, 2L, 5L)));
Assert.assertEquals(this.newMutableCollectionWith(1L, 2L), collection);
MutableLongCollection collection1 = this.classUnderTest();
Assert.assertTrue(collection1.retainAll(this.newMutableCollectionWith(-3L, 1L)));
Assert.assertEquals(this.newMutableCollectionWith(1L), collection1);
Assert.assertTrue(collection1.retainAll(this.newMutableCollectionWith(-1L)));
Verify.assertEmpty(collection1);
MutableLongCollection collection2 = this.newWith(0L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L);
Assert.assertFalse(collection2.retainAll(this.newMutableCollectionWith(0L, 1L, 2L, 3L)));
Assert.assertTrue(collection2.retainAll(LongArrayList.newListWith(0L, 1L, 3L)));
Assert.assertEquals(this.newMutableCollectionWith(0L, 1L, 1L, 3L, 3L, 3L), collection2);
Assert.assertFalse(collection2.retainAll(LongArrayList.newListWith(0L, 1L, 3L)));
Assert.assertTrue(collection2.retainAll(LongArrayList.newListWith(5L, 3L)));
Assert.assertEquals(this.newMutableCollectionWith(3L, 3L, 3L), collection2);
MutableLongCollection collection3 = this.newWith(0L, 1L, 1L, 2L, 2L, 2L);
Assert.assertTrue(collection3.retainAll(LongHashBag.newBagWith(2L, 8L, 8L, 2L)));
Assert.assertEquals(this.newMutableCollectionWith(2L, 2L, 2L), collection3);
MutableLongCollection collection4 = this.classUnderTest();
Assert.assertTrue(collection4.retainAll(new LongArrayList()));
Verify.assertEmpty(collection4);
}
Aggregations