use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class AbstractMutableObjectBooleanMapTestCase method iterator_remove.
@Test
public void iterator_remove() {
MutableObjectBooleanMap<String> map = this.classUnderTest();
Verify.assertNotEmpty(map);
MutableBooleanIterator booleanIterator = map.booleanIterator();
while (booleanIterator.hasNext()) {
booleanIterator.next();
booleanIterator.remove();
}
Verify.assertEmpty(map);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class AbstractMutableBooleanCollectionTestCase method iterator_throws_on_consecutive_invocation_of_remove.
@Test
public void iterator_throws_on_consecutive_invocation_of_remove() {
MutableBooleanCollection booleanIterable = this.newWith(true, false);
MutableBooleanIterator iterator = booleanIterable.booleanIterator();
iterator.next();
iterator.remove();
Verify.assertThrows(IllegalStateException.class, iterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class AbstractMutableBooleanCollectionTestCase method iterator_throws_on_invocation_of_remove_before_next.
@Test
public void iterator_throws_on_invocation_of_remove_before_next() {
MutableBooleanCollection booleanIterable = this.newWith(true, false);
MutableBooleanIterator iterator = booleanIterable.booleanIterator();
Assert.assertTrue(iterator.hasNext());
Verify.assertThrows(IllegalStateException.class, iterator::remove);
}
Aggregations