use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class AbstractMutableBooleanCollectionTestCase method booleanIterator_with_remove.
@Test
public void booleanIterator_with_remove() {
MutableBooleanCollection booleanIterable = this.classUnderTest();
MutableBooleanIterator iterator = booleanIterable.booleanIterator();
int iterationCount = booleanIterable.size();
int iterableSize = booleanIterable.size();
for (int i = 0; i < iterationCount; i++) {
Verify.assertSize(iterableSize--, booleanIterable);
Assert.assertTrue(iterator.hasNext());
iterator.next();
iterator.remove();
Verify.assertSize(iterableSize, booleanIterable);
}
Verify.assertEmpty(booleanIterable);
Assert.assertFalse(iterator.hasNext());
Verify.assertThrows(NoSuchElementException.class, (Runnable) iterator::next);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class UnmodifiableBooleanStackTest method booleanIterator_with_remove.
@Test
public void booleanIterator_with_remove() {
MutableBooleanIterator booleanIterator = (MutableBooleanIterator) this.classUnderTest().booleanIterator();
Assert.assertTrue(booleanIterator.hasNext());
booleanIterator.next();
Verify.assertThrows(UnsupportedOperationException.class, booleanIterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class UnmodifiableObjectBooleanMapTest method iterator_throws_on_invocation_of_remove_before_next.
@Override
@Test
public void iterator_throws_on_invocation_of_remove_before_next() {
UnmodifiableObjectBooleanMap<String> map = this.classUnderTest();
MutableBooleanIterator booleanIterator = map.booleanIterator();
Assert.assertTrue(booleanIterator.hasNext());
Verify.assertThrows(UnsupportedOperationException.class, booleanIterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class UnmodifiableObjectBooleanMapTest method iterator_remove.
@Override
@Test
public void iterator_remove() {
UnmodifiableObjectBooleanMap<String> map = this.classUnderTest();
Verify.assertNotEmpty(map);
MutableBooleanIterator booleanIterator = map.booleanIterator();
Assert.assertTrue(booleanIterator.hasNext());
booleanIterator.next();
Verify.assertThrows(UnsupportedOperationException.class, booleanIterator::remove);
}
use of org.eclipse.collections.api.iterator.MutableBooleanIterator in project eclipse-collections by eclipse.
the class UnmodifiableBooleanBagTest method booleanIterator_with_remove.
@Override
@Test
public void booleanIterator_with_remove() {
MutableBooleanIterator booleanIterator = this.classUnderTest().booleanIterator();
Assert.assertTrue(booleanIterator.hasNext());
booleanIterator.next();
Verify.assertThrows(UnsupportedOperationException.class, booleanIterator::remove);
}
Aggregations