use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.
the class LongLongHashMapValuesTest method longIterator.
@Override
@Test
public void longIterator() {
MutableLongCollection bag = this.newWith(0L, 1L, 2L, 3L);
LongArrayList list = LongArrayList.newListWith(0L, 1L, 2L, 3L);
LongIterator iterator = bag.longIterator();
for (int i = 0; i < 4; i++) {
Assert.assertTrue(iterator.hasNext());
Assert.assertTrue(list.remove(iterator.next()));
}
Verify.assertEmpty(list);
Assert.assertFalse(iterator.hasNext());
Verify.assertThrows(NoSuchElementException.class, iterator::next);
}
use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.
the class AbstractLongSetTestCase method longIterator.
@Override
@Test
public void longIterator() {
MutableSet<Long> expected = UnifiedSet.newSetWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
MutableSet<Long> actual = UnifiedSet.newSet();
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
LongIterator iterator = set.longIterator();
Assert.assertTrue(iterator.hasNext());
actual.add(iterator.next());
Assert.assertTrue(iterator.hasNext());
actual.add(iterator.next());
Assert.assertTrue(iterator.hasNext());
actual.add(iterator.next());
Assert.assertTrue(iterator.hasNext());
actual.add(iterator.next());
Assert.assertTrue(iterator.hasNext());
actual.add(iterator.next());
Assert.assertFalse(iterator.hasNext());
Assert.assertEquals(expected, actual);
Verify.assertThrows(NoSuchElementException.class, iterator::next);
}
use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.
the class AbstractLongSetTestCase method longIterator_throws.
@Override
@Test(expected = NoSuchElementException.class)
public void longIterator_throws() {
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
LongIterator iterator = set.longIterator();
while (iterator.hasNext()) {
iterator.next();
}
iterator.next();
}
use of org.eclipse.collections.api.iterator.LongIterator in project narchy by automenta.
the class Conj method shift.
public long shift() {
long min = Long.MAX_VALUE;
LongIterator ii = event.keysView().longIterator();
while (ii.hasNext()) {
long t = ii.next();
if (t != DTERNAL) {
if (t < min)
min = t;
}
}
return min;
}
use of org.eclipse.collections.api.iterator.LongIterator in project mapdb by jankotek.
the class AbstractLongSetTestCase method longIterator_throws.
@Override
@Test(expected = NoSuchElementException.class)
public void longIterator_throws() {
MutableLongSet set = this.newWith(0L, 1L, 31L, AbstractLongSetTestCase.generateCollisions1().getFirst(), AbstractLongSetTestCase.generateCollisions1().get(1));
LongIterator iterator = set.longIterator();
while (iterator.hasNext()) {
iterator.next();
}
iterator.next();
}
Aggregations