Search in sources :

Example 96 with MutableLongSet

use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.

the class AbstractLongSetTestCase method detectIfNone.

@Override
@Test
public void detectIfNone() {
    super.detectIfNone();
    MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
    Assert.assertEquals(0L, set.detectIfNone(LongPredicates.lessThan(1L), 9L));
    Assert.assertEquals(AbstractLongSetTestCase.generateCollisions1().get(1), set.detectIfNone(LongPredicates.greaterThan(AbstractLongSetTestCase.generateCollisions1().getFirst()), 9L));
    Assert.assertEquals(9L, set.detectIfNone(LongPredicates.greaterThan(AbstractLongSetTestCase.generateCollisions1().get(1)), 9L));
}
Also used : MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) Test(org.junit.Test)

Example 97 with MutableLongSet

use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.

the class LongLongHashMapKeySetTest method testHashCode.

@Override
public void testHashCode() {
    MutableLongSet set1 = this.newWith(0L, 1L, 31L, 32L);
    MutableLongSet set2 = this.newWith(32L, 31L, 1L, 0L);
    Assert.assertEquals(set1.hashCode(), set2.hashCode());
// Assert.assertEquals(this.newObjectCollectionWith(0L, 1L, 31L, 32L).hashCode(), set1.hashCode());
}
Also used : MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet)

Example 98 with MutableLongSet

use of org.eclipse.collections.api.set.primitive.MutableLongSet 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);
}
Also used : LongHashSet(org.eclipse.collections.impl.set.mutable.primitive.LongHashSet) MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) LongArrayList(org.eclipse.collections.impl.list.mutable.primitive.LongArrayList) Test(org.junit.Test)

Example 99 with MutableLongSet

use of org.eclipse.collections.api.set.primitive.MutableLongSet in project mapdb by jankotek.

the class AbstractLongSetTestCase method testHashCode.

@Override
@Test
public void testHashCode() {
    super.testEquals();
    MutableLongSet set1 = this.newWith(1L, 31L, 32L);
    MutableLongSet set2 = this.newWith(32L, 31L, 1L);
    Assert.assertEquals(set1.hashCode(), set2.hashCode());
}
Also used : MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) Test(org.junit.Test)

Example 100 with MutableLongSet

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)));
}
Also used : MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) Test(org.junit.Test)

Aggregations

MutableLongSet (org.eclipse.collections.api.set.primitive.MutableLongSet)153 LongHashSet (org.eclipse.collections.impl.set.mutable.primitive.LongHashSet)57 Test (org.junit.jupiter.api.Test)54 Test (org.junit.Test)49 IndexReadSession (org.neo4j.internal.kernel.api.IndexReadSession)17 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)17 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)14 ArrayList (java.util.ArrayList)13 IndexValueCapability (org.neo4j.internal.schema.IndexValueCapability)12 LongIterator (org.eclipse.collections.api.iterator.LongIterator)10 LongSet (org.eclipse.collections.api.set.primitive.LongSet)9 Value (org.neo4j.values.storable.Value)8 Map (java.util.Map)7 MutableLongList (org.eclipse.collections.api.list.primitive.MutableLongList)7 Transaction (org.neo4j.graphdb.Transaction)7 Write (org.neo4j.internal.kernel.api.Write)7 NavigableMap (java.util.NavigableMap)6 UnmodifiableMap (org.eclipse.collections.impl.UnmodifiableMap)6 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)6 IndexQueryConstraints (org.neo4j.internal.kernel.api.IndexQueryConstraints)6