use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractLongSetTestCase method generateNonCollisions.
private static LongArrayList generateNonCollisions() {
LongArrayList collisions = new LongArrayList();
LongHashSet set = new LongHashSet();
for (long i = 32L; collisions.size() <= 10; i++) {
// if (set.spreadAndMask(i) != set.spreadAndMask(32L))
{
collisions.add(i);
}
}
return collisions;
}
use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractLongSetTestCase method removeAll_iterable.
@Override
@Test
public void removeAll_iterable() {
super.removeAll_iterable();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Assert.assertFalse(set.removeAll(new LongArrayList()));
Assert.assertFalse(set.removeAll(LongArrayList.newListWith(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(LongHashSet.newSetWith(0L, 31L, AbstractLongSetTestCase.generateCollisions1().get(4))));
Assert.assertEquals(LongHashSet.newSetWith(1L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.removeAll(LongHashSet.newSetWith(1L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1))));
Assert.assertEquals(new LongHashSet(), set);
Assert.assertFalse(set.removeAll(LongHashSet.newSetWith(1L)));
Assert.assertEquals(new LongHashSet(), set);
}
use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractMutableLongLongMapTestCase method generateCollisions.
protected static LongArrayList generateCollisions() {
LongArrayList collisions = new LongArrayList();
LongLongHashMap hashMap = new LongLongHashMap();
for (long each = 2L; collisions.size() <= 10; each++) {
// if (hashMap.spreadAndMask(each) == hashMap.spreadAndMask(2L))
{
collisions.add(each);
}
}
return collisions;
}
use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractLongSetTestCase method addAllIterable.
@Override
@Test
public void addAllIterable() {
super.addAllIterable();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Assert.assertFalse(set.addAll(new LongArrayList()));
Assert.assertFalse(set.addAll(LongArrayList.newListWith(31L, AbstractLongSetTestCase.generateCollisions1().get(0), AbstractLongSetTestCase.generateCollisions1().get(1))));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1)), set);
Assert.assertTrue(set.addAll(LongHashSet.newSetWith(0L, 1L, 2L, 30L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(4))));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 2L, 30L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1), AbstractLongSetTestCase.generateCollisions1().get(4)), set);
Assert.assertTrue(set.addAll(LongHashSet.newSetWith(5L)));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 2L, 5L, 30L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1), AbstractLongSetTestCase.generateCollisions1().get(4)), set);
Assert.assertTrue(set.addAll(LongHashSet.newSetWith(AbstractLongSetTestCase.generateCollisions1().get(5))));
Assert.assertEquals(LongHashSet.newSetWith(0L, 1L, 2L, 5L, 30L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1), AbstractLongSetTestCase.generateCollisions1().get(4), AbstractLongSetTestCase.generateCollisions1().get(5)), set);
LongHashSet set1 = new LongHashSet();
Assert.assertTrue(set1.addAll(2L, 35L));
Assert.assertEquals(LongHashSet.newSetWith(2L, 35L), set1);
}
use of org.eclipse.collections.impl.list.mutable.primitive.LongArrayList in project mapdb by jankotek.
the class AbstractLongSetTestCase method generateCollisions1.
protected static LongArrayList generateCollisions1() {
LongArrayList collisions = new LongArrayList();
LongHashSet set = new LongHashSet();
for (long i = 32L; collisions.size() <= 10; i++) {
// if (set.spreadAndMask(i) == set.spreadAndMask(32L))
{
collisions.add(i);
}
}
return collisions;
}
Aggregations