use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method testEquals.
@Override
@Test
public void testEquals() {
super.testEquals();
MutableLongSet set1 = this.newWith(1L, 31L, 32L);
MutableLongSet set2 = this.newWith(32L, 31L, 1L);
MutableLongSet set3 = this.newWith(32L, 32L, 31L, 1L);
MutableLongSet set4 = this.newWith(32L, 32L, 31L, 1L, 1L);
Verify.assertEqualsAndHashCode(set1, set2);
Verify.assertEqualsAndHashCode(set1, set3);
Verify.assertEqualsAndHashCode(set1, set4);
Verify.assertEqualsAndHashCode(set2, set3);
Verify.assertEqualsAndHashCode(set2, set4);
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method forEach.
@Override
@Test
public void forEach() {
super.forEach();
long[] sum = new long[1];
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
set.forEach((long each) -> sum[0] += each);
Assert.assertEquals(32L + AbstractLongSetTestCase.generateCollisions1().getFirst() + AbstractLongSetTestCase.generateCollisions1().get(1), sum[0]);
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class LongLongHashMapKeySetTest method testEquals.
@Override
public void testEquals() {
MutableLongSet set1 = this.newWith(1L, 31L, 32L);
MutableLongSet set2 = this.newWith(32L, 31L, 1L);
MutableLongSet set3 = this.newWith(32L, 32L, 31L, 1L);
MutableLongSet set4 = this.newWith(32L, 32L, 31L, 1L, 1L);
MutableLongSet set5 = this.newWith(32L, 1L);
Verify.assertEqualsAndHashCode(set1, set2);
Verify.assertEqualsAndHashCode(set1, set3);
Verify.assertEqualsAndHashCode(set1, set4);
Verify.assertEqualsAndHashCode(set2, set3);
Verify.assertEqualsAndHashCode(set2, set4);
Assert.assertNotEquals(set1, set5);
}
use of org.eclipse.collections.api.set.primitive.MutableLongSet 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.api.set.primitive.MutableLongSet in project mapdb by jankotek.
the class AbstractLongSetTestCase method reject.
@Override
@Test
public void reject() {
super.reject();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
Verify.assertSize(1, set.reject(LongPredicates.greaterThan(0L)));
Verify.assertSize(2, set.reject(LongPredicates.lessThan(32L)));
}
Aggregations