use of org.eclipse.collections.api.iterator.MutableLongIterator in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method longIterator_throws_for_remove_before_next.
@Test
public void longIterator_throws_for_remove_before_next() {
MutableLongCollection longIterable = this.classUnderTest();
final MutableLongIterator iterator = longIterable.longIterator();
Assert.assertTrue(iterator.hasNext());
Verify.assertThrows(IllegalStateException.class, new Runnable() {
@Override
public void run() {
iterator.remove();
}
});
}
use of org.eclipse.collections.api.iterator.MutableLongIterator in project mapdb by jankotek.
the class AbstractMutableLongLongMapTestCase method iterator_throws_on_consecutive_invocation_of_remove.
@Test
public void iterator_throws_on_consecutive_invocation_of_remove() {
MutableLongIterator iterator = this.classUnderTest().longIterator();
Assert.assertTrue(iterator.hasNext());
iterator.next();
iterator.remove();
Verify.assertThrows(IllegalStateException.class, iterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableLongIterator in project mapdb by jankotek.
the class AbstractMutableLongLongMapTestCase method iterator_throws_on_invocation_of_remove_before_next.
@Test
public void iterator_throws_on_invocation_of_remove_before_next() {
MutableLongIterator iterator = this.classUnderTest().longIterator();
Assert.assertTrue(iterator.hasNext());
Verify.assertThrows(IllegalStateException.class, iterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableLongIterator in project mapdb by jankotek.
the class AbstractMutableLongLongMapTestCase method longIterator_with_remove.
@Test
public void longIterator_with_remove() {
MutableLongLongMap mutableMap = this.classUnderTest();
MutableLongIterator iterator = mutableMap.longIterator();
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
}
Assert.assertFalse(iterator.hasNext());
Verify.assertEmpty(mutableMap);
Verify.assertThrows(NoSuchElementException.class, iterator::next);
}
use of org.eclipse.collections.api.iterator.MutableLongIterator in project mapdb by jankotek.
the class AbstractMutableLongCollectionTestCase method longIterator_with_remove.
@Test
public void longIterator_with_remove() {
MutableLongCollection longIterable = this.newWith(0L, 1L, 31L, 32L);
final MutableLongIterator iterator = longIterable.longIterator();
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
}
Verify.assertEmpty(longIterable);
Verify.assertThrows(NoSuchElementException.class, new Runnable() {
@Override
public void run() {
iterator.next();
}
});
}
Aggregations