use of org.neo4j.kernel.impl.util.diffsets.DiffSets in project neo4j by neo4j.
the class LongDiffSetsTest method shouldContainAddedElementsForDiffSetsWithAddedElements.
@Test
public void shouldContainAddedElementsForDiffSetsWithAddedElements() throws Exception {
// given
DiffSets<Long> diffSets = new DiffSets<>();
diffSets.add(19L);
diffSets.add(20L);
Iterator<Long> expected = diffSets.apply(iteratorSource(19L));
// when
PrimitiveLongIterator actual = diffSets.augment(iterator(19L));
// then
assertThat(expected, hasSamePrimitiveItems(actual));
}
use of org.neo4j.kernel.impl.util.diffsets.DiffSets in project neo4j by neo4j.
the class LongDiffSetsTest method shouldContainFilteredSourceForDiffSetsWithRemovedElements.
@Test
public void shouldContainFilteredSourceForDiffSetsWithRemovedElements() throws Exception {
// given
DiffSets<Long> diffSets = new DiffSets<>();
diffSets.remove(17L);
diffSets.remove(18L);
Iterator<Long> expected = diffSets.apply(iteratorSource(1L, 17L, 3L));
// when
PrimitiveLongIterator actual = diffSets.augment(iterator(1L, 17L, 3L));
// then
assertThat(expected, hasSamePrimitiveItems(actual));
}
Aggregations