use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method removeAll.
@Override
@Test
public void removeAll() {
super.removeAll();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Assert.assertFalse(set.removeAll());
Assert.assertFalse(set.removeAll(15L, AbstractLongSetTestCase.generateCollisions1().get(2), AbstractLongSetTestCase.generateCollisions1().get(3)));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.removeAll(0L, 31L, AbstractLongSetTestCase.generateCollisions1().get(3)));
Assert.assertEquals(LongHashSet.newSetWith(1L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.removeAll(1L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)));
Assert.assertEquals(new LongHashSet(), set);
Assert.assertFalse(set.removeAll(1L));
Assert.assertEquals(new LongHashSet(), set);
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method select.
@Override
@Test
public void select() {
super.select();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Verify.assertSize(3, set.select(LongPredicates.lessThan(32L)));
Verify.assertSize(4, set.select(LongPredicates.greaterThan(0L)));
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method retainAll_iterable.
@Override
@Test
public void retainAll_iterable() {
super.retainAll_iterable();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Assert.assertFalse(set.retainAll(LongHashSet.newSetWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1))));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.retainAll(LongHashSet.newSetWith(0L, 31L, AbstractLongSetTestCase.generateCollisions1().get(4), AbstractLongSetTestCase.generateCollisions1().get(1))));
Assert.assertEquals(LongHashSet.newSetWith(0L, 31L, AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.retainAll(LongHashSet.newSetWith(1L, AbstractLongSetTestCase.generateCollisions1().getFirst())));
Assert.assertEquals(new LongHashSet(), set);
Assert.assertFalse(set.retainAll(LongHashSet.newSetWith(1L)));
Assert.assertEquals(new LongHashSet(), set);
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method clear.
@Override
@Test
public void clear() {
super.clear();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
set.clear();
Verify.assertSize(0, set);
Assert.assertFalse(set.contains(0L));
Assert.assertFalse(set.contains(31L));
Assert.assertFalse(set.contains(1L));
Assert.assertFalse(set.contains(AbstractLongSetTestCase.generateCollisions1().getFirst()));
Assert.assertFalse(set.contains(AbstractLongSetTestCase.generateCollisions1().get(1)));
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method remove.
@Override
@Test
public void remove() {
super.remove();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Assert.assertFalse(this.newWith().remove(15L));
Assert.assertFalse(set.remove(15L));
Assert.assertTrue(set.remove(0L));
Assert.assertEquals(LongHashSet.newSetWith(1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
// Assert.assertFalse(set.remove(AbstractLongSetTestCase.generateNonCollisions().getFirst()));
Assert.assertFalse(set.remove(AbstractLongSetTestCase.generateCollisions1().get(3)));
Assert.assertTrue(set.remove(AbstractLongSetTestCase.generateCollisions1().get(1)));
Assert.assertEquals(LongHashSet.newSetWith(1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst()), set);
Assert.assertTrue(set.remove(AbstractLongSetTestCase.generateCollisions1().getFirst()));
Assert.assertEquals(LongHashSet.newSetWith(1L, 31L), set);
Assert.assertTrue(set.remove(31L));
Assert.assertEquals(LongHashSet.newSetWith(1L), set);
Assert.assertTrue(set.remove(1L));
Assert.assertEquals(LongHashSet.newSetWith(), set);
}
Aggregations