//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void doNotIterateOverDeletedElement() public virtual void DoNotIterateOverDeletedElement() { LongIterator source = iterator(3L, 5L); LongSet added = LongHashSet.newSetWith(1L); LongSet removed = LongHashSet.newSetWith(3L); LongIterator iterator = DiffApplyingPrimitiveLongIterator.Augment(source, added, removed); ISet <long> resultSet = toSet(iterator); assertThat(resultSet, containsInAnyOrder(1L, 5L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void appendSourceElementsDuringIteration() public virtual void AppendSourceElementsDuringIteration() { LongIterator source = iterator(4L, 5L); LongSet added = LongHashSet.newSetWith(1L, 2L); LongSet removed = LongHashSet.newSetWith(3L); LongIterator iterator = DiffApplyingPrimitiveLongIterator.Augment(source, added, removed); ISet <long> resultSet = toSet(iterator); assertThat(resultSet, containsInAnyOrder(1L, 2L, 4L, 5L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void iterateOnlyOverAddedElementsWhenSourceIsEmpty() public virtual void IterateOnlyOverAddedElementsWhenSourceIsEmpty() { LongIterator emptySource = ImmutableEmptyLongIterator.INSTANCE; LongSet added = LongHashSet.newSetWith(1L, 2L); LongSet removed = LongHashSet.newSetWith(3L); LongIterator iterator = DiffApplyingPrimitiveLongIterator.Augment(emptySource, added, removed); ISet <long> resultSet = toSet(iterator); assertThat(resultSet, containsInAnyOrder(1L, 2L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void closeResource() public virtual void CloseResource() { Resource resource = Mockito.mock(typeof(Resource)); PrimitiveLongResourceIterator source = resourceIterator(ImmutableEmptyLongIterator.INSTANCE, resource); PrimitiveLongResourceIterator iterator = DiffApplyingPrimitiveLongIterator.Augment(source, LongSets.immutable.empty(), LongSets.immutable.empty()); iterator.Close(); Mockito.verify(resource).close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void doNotIterateTwiceOverSameElementsWhenItsPartOfSourceAndAdded() public virtual void DoNotIterateTwiceOverSameElementsWhenItsPartOfSourceAndAdded() { LongIterator source = iterator(4L, 5L); LongSet added = LongHashSet.newSetWith(1L, 4L); LongSet removed = LongHashSet.newSetWith(3L); LongIterator iterator = DiffApplyingPrimitiveLongIterator.Augment(source, added, removed); long?[] values = ArrayUtils.toObject(asArray(iterator)); assertThat(values, arrayContainingInAnyOrder(1L, 4L, 5L)); assertThat(values, arrayWithSize(3)); }
public override PrimitiveLongResourceIterator Augment(PrimitiveLongResourceIterator source) { return(DiffApplyingPrimitiveLongIterator.Augment(source, _added, _removed)); }