use of org.neo4j.kernel.impl.util.collection.CollectionsFactory in project neo4j by neo4j.
the class MutableLongDiffSetsImplTest method useCollectionsFactory.
@Test
void useCollectionsFactory() {
final MutableLongSet set1 = new LongHashSet();
final MutableLongSet set2 = new LongHashSet();
final CollectionsFactory collectionsFactory = mock(CollectionsFactory.class);
doReturn(set1, set2).when(collectionsFactory).newLongSet(EmptyMemoryTracker.INSTANCE);
final MutableLongDiffSetsImpl diffSets = new MutableLongDiffSetsImpl(collectionsFactory, EmptyMemoryTracker.INSTANCE);
diffSets.add(1L);
diffSets.remove(2L);
assertSame(set1, diffSets.getAdded());
assertSame(set2, diffSets.getRemoved());
verify(collectionsFactory, times(2)).newLongSet(EmptyMemoryTracker.INSTANCE);
verifyNoMoreInteractions(collectionsFactory);
}
Aggregations