Search in sources :

Example 16 with PrimitiveLongIntMap

use of org.neo4j.collection.primitive.PrimitiveLongIntMap in project neo4j by neo4j.

the class PrimitiveLongMapTest method verifyMapRetainsAllEntries.

private void verifyMapRetainsAllEntries(List<Long> lst) {
    PrimitiveLongIntMap map = Primitive.longIntMap();
    Set<Long> set = new HashSet<>();
    for (Long value : lst) {
        assertThat(map.put(value, 1), is(-1));
        assertTrue(set.add(value));
    }
    assertThat(map.size(), is(set.size()));
    for (Long aLong : set) {
        assertThat(map.get(aLong), is(1));
    }
}
Also used : PrimitiveLongIntMap(org.neo4j.collection.primitive.PrimitiveLongIntMap) HashSet(java.util.HashSet)

Aggregations

PrimitiveLongIntMap (org.neo4j.collection.primitive.PrimitiveLongIntMap)16 Test (org.junit.Test)7 ActiveLock (org.neo4j.kernel.impl.locking.ActiveLock)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 LockWaitEvent (org.neo4j.kernel.impl.locking.LockWaitEvent)2 HashSet (java.util.HashSet)1 ResourceType (org.neo4j.storageengine.api.lock.ResourceType)1