Search in sources :

Example 1 with PrimitiveLongLongVisitor

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

the class PrimitiveLongMapTest method longLongEntryVisitorShouldSeeAllEntriesIfItDoesNotBreakOut.

@SuppressWarnings("unchecked")
@Test
public void longLongEntryVisitorShouldSeeAllEntriesIfItDoesNotBreakOut() {
    // GIVEN
    PrimitiveLongLongVisitor<RuntimeException> visitor;
    try (PrimitiveLongLongMap map = Primitive.offHeapLongLongMap()) {
        map.put(1, 100);
        map.put(2, 200);
        map.put(3, 300);
        visitor = mock(PrimitiveLongLongVisitor.class);
        // WHEN
        map.visitEntries(visitor);
    }
    // THEN
    verify(visitor).visited(1, 100);
    verify(visitor).visited(2, 200);
    verify(visitor).visited(3, 300);
    verifyNoMoreInteractions(visitor);
}
Also used : PrimitiveLongLongVisitor(org.neo4j.collection.primitive.PrimitiveLongLongVisitor) PrimitiveLongLongMap(org.neo4j.collection.primitive.PrimitiveLongLongMap) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PrimitiveLongLongMap (org.neo4j.collection.primitive.PrimitiveLongLongMap)1 PrimitiveLongLongVisitor (org.neo4j.collection.primitive.PrimitiveLongLongVisitor)1