Search in sources :

Example 31 with LongIterator

use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.

the class AbstractLazyLongIterableTestCase method longIterator.

@Test
public void longIterator() {
    long sum = 0L;
    for (LongIterator iterator = this.classUnderTest().longIterator(); iterator.hasNext(); ) {
        sum += iterator.next();
    }
    Assert.assertEquals(6L, sum);
}
Also used : LongIterator(org.eclipse.collections.api.iterator.LongIterator) Test(org.junit.Test)

Example 32 with LongIterator

use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.

the class AbstractLongIterableTestCase method longIterator_throws_non_empty_collection.

@Test(expected = NoSuchElementException.class)
public void longIterator_throws_non_empty_collection() {
    LongIterable iterable = this.newWith(1L, 2L, 3L);
    LongIterator iterator = iterable.longIterator();
    while (iterator.hasNext()) {
        iterator.next();
    }
    iterator.next();
}
Also used : LazyLongIterable(org.eclipse.collections.api.LazyLongIterable) LongIterable(org.eclipse.collections.api.LongIterable) LongIterator(org.eclipse.collections.api.iterator.LongIterator) Test(org.junit.Test)

Example 33 with LongIterator

use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.

the class AbstractLongIterableTestCase method longIterator_throws.

@Test(expected = NoSuchElementException.class)
public void longIterator_throws() {
    LongIterator iterator = this.classUnderTest().longIterator();
    while (iterator.hasNext()) {
        iterator.next();
    }
    iterator.next();
}
Also used : LongIterator(org.eclipse.collections.api.iterator.LongIterator) Test(org.junit.Test)

Example 34 with LongIterator

use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.

the class AbstractLongIterableTestCase method longIterator_throws.

@Test(expected = NoSuchElementException.class)
public void longIterator_throws() {
    LongIterator iterator = this.classUnderTest().longIterator();
    while (iterator.hasNext()) {
        iterator.next();
    }
    iterator.next();
}
Also used : LongIterator(org.eclipse.collections.api.iterator.LongIterator) Test(org.junit.Test)

Example 35 with LongIterator

use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.

the class AbstractLazyLongIterableTestCase method longIterator.

@Test
public void longIterator() {
    long sum = 0L;
    for (LongIterator iterator = this.classUnderTest().longIterator(); iterator.hasNext(); ) {
        sum += iterator.next();
    }
    Assert.assertEquals(6L, sum);
}
Also used : LongIterator(org.eclipse.collections.api.iterator.LongIterator) Test(org.junit.Test)

Aggregations

LongIterator (org.eclipse.collections.api.iterator.LongIterator)45 Test (org.junit.Test)16 Test (org.junit.jupiter.api.Test)15 MutableLongSet (org.eclipse.collections.api.set.primitive.MutableLongSet)9 MutableLongIterator (org.eclipse.collections.api.iterator.MutableLongIterator)5 MutableLongCollection (org.eclipse.collections.api.collection.primitive.MutableLongCollection)4 LongSet (org.eclipse.collections.api.set.primitive.LongSet)3 IndexReaderStub (org.neo4j.kernel.api.impl.index.IndexReaderStub)3 LazyLongIterable (org.eclipse.collections.api.LazyLongIterable)2 LongIterable (org.eclipse.collections.api.LongIterable)2 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 RelationshipChangesForNode.createRelationshipChangesForNode (org.neo4j.kernel.impl.api.state.RelationshipChangesForNode.createRelationshipChangesForNode)2 IOException (java.io.IOException)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 MutableLongList (org.eclipse.collections.api.list.primitive.MutableLongList)1 ImmutableEmptyLongIterator (org.eclipse.collections.impl.iterator.ImmutableEmptyLongIterator)1 AbstractPrimitiveLongBaseIterator (org.neo4j.collection.PrimitiveLongCollections.AbstractPrimitiveLongBaseIterator)1 RangeLongIterator (org.neo4j.collection.RangeLongIterator)1