Search in sources :

Example 6 with LongIterator

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

the class AbstractLazyLongIterableTestCase 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 7 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 8 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 9 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)

Aggregations

LongIterator (org.eclipse.collections.api.iterator.LongIterator)9 Test (org.junit.Test)9 MutableLongSet (org.eclipse.collections.api.set.primitive.MutableLongSet)3 MutableLongCollection (org.eclipse.collections.api.collection.primitive.MutableLongCollection)2 LazyLongIterable (org.eclipse.collections.api.LazyLongIterable)1 LongIterable (org.eclipse.collections.api.LongIterable)1 MutableLongIterator (org.eclipse.collections.api.iterator.MutableLongIterator)1 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)1