use of org.eclipse.collections.api.collection.primitive.MutableLongCollection in project mapdb by jankotek.
the class LongLongHashMapValuesTest method asUnmodifiable.
@Override
@Test
@Ignore
public void asUnmodifiable() {
MutableLongCollection collection = this.classUnderTest();
Verify.assertInstanceOf(UnmodifiableLongCollection.class, collection.asUnmodifiable());
Assert.assertTrue(collection.asUnmodifiable().containsAll(this.classUnderTest()));
}
use of org.eclipse.collections.api.collection.primitive.MutableLongCollection in project mapdb by jankotek.
the class LongLongHashMapValuesTest method removeAll_iterable.
@Override
@Test
public void removeAll_iterable() {
Assert.assertFalse(this.newWith().removeAll(new LongArrayList()));
Assert.assertFalse(this.newWith().removeAll(LongArrayList.newListWith(1L)));
MutableLongLongMap map = newWithKeysValues(1L, 1L, 2L, 2L, 3L, 3L);
MutableLongCollection collection = map.values();
Assert.assertFalse(collection.removeAll());
Assert.assertTrue(collection.removeAll(LongArrayList.newListWith(1L, 5L)));
Assert.assertFalse(collection.contains(1L));
Assert.assertTrue(collection.contains(2L));
Assert.assertTrue(collection.contains(3L));
Assert.assertFalse(map.contains(1L));
Assert.assertTrue(map.contains(2L));
Assert.assertTrue(map.contains(3L));
Assert.assertTrue(collection.removeAll(LongArrayList.newListWith(3L, 2L)));
Assert.assertTrue(collection.isEmpty());
Assert.assertFalse(collection.contains(1L));
Assert.assertFalse(collection.contains(2L));
Assert.assertFalse(collection.contains(3L));
Assert.assertFalse(map.contains(1L));
Assert.assertFalse(map.contains(2L));
Assert.assertFalse(map.contains(3L));
Assert.assertTrue(map.isEmpty());
}
use of org.eclipse.collections.api.collection.primitive.MutableLongCollection in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method removeAll.
@Test
public void removeAll() {
Assert.assertFalse(this.newWith().removeAll());
Assert.assertFalse(this.newWith().removeAll(1L));
MutableLongCollection collection = this.classUnderTest();
Assert.assertFalse(collection.removeAll());
Assert.assertFalse(collection.removeAll(-1L));
Assert.assertEquals(this.newMutableCollectionWith(1L, 2L, 3L), collection);
Assert.assertTrue(collection.removeAll(1L, 5L));
Assert.assertEquals(this.newMutableCollectionWith(2L, 3L), collection);
Assert.assertTrue(collection.removeAll(3L, 2L));
Assert.assertEquals(this.newMutableCollectionWith(), collection);
MutableLongCollection collection1 = this.newWith(0L, 1L, 1L, 2L, 2L, 2L);
Assert.assertFalse(collection1.removeAll());
Assert.assertTrue(collection1.removeAll(0L, 1L));
Assert.assertEquals(this.newMutableCollectionWith(2L, 2L, 2L), collection1);
}
use of org.eclipse.collections.api.collection.primitive.MutableLongCollection in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method addAllArray.
@Test
public void addAllArray() {
MutableLongCollection collection = this.classUnderTest();
Assert.assertFalse(collection.addAll());
Assert.assertTrue(collection.addAll(4L, 5L, 6L));
Assert.assertEquals(this.newMutableCollectionWith(1L, 2L, 3L, 4L, 5L, 6L), collection);
}
use of org.eclipse.collections.api.collection.primitive.MutableLongCollection in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method contains.
@Override
@Test
public void contains() {
super.contains();
MutableLongCollection collection = this.newWith(14L, 2L, 30L, 31L, 32L, 35L, 0L, 1L);
Assert.assertFalse(collection.contains(29L));
Assert.assertFalse(collection.contains(49L));
long[] numbers = { 14L, 2L, 30L, 31L, 32L, 35L, 0L, 1L };
for (long number : numbers) {
Assert.assertTrue(collection.contains(number));
Assert.assertTrue(collection.remove(number));
Assert.assertFalse(collection.contains(number));
}
Assert.assertFalse(collection.contains(-1L));
Assert.assertFalse(collection.contains(29L));
Assert.assertFalse(collection.contains(49L));
}
Aggregations