Ejemplo n.º 1
0
//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));
        }
Ejemplo n.º 2
0
//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));
        }
Ejemplo n.º 3
0
//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));
        }
Ejemplo n.º 4
0
//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));
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public static org.eclipse.collections.api.set.primitive.MutableLongSet labels(final long... labels)
        public static MutableLongSet Labels(params long[] labels)
        {
            return(LongHashSet.newSetWith(labels));
        }