use of org.eclipse.collections.api.iterator.ByteIterator in project eclipse-collections by eclipse.
the class AbstractImmutableByteHashSetTestCase method byteIterator_throws.
@Override
@Test(expected = NoSuchElementException.class)
public void byteIterator_throws() {
ImmutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31);
ByteIterator iterator = set.byteIterator();
while (iterator.hasNext()) {
iterator.next();
}
iterator.next();
}
use of org.eclipse.collections.api.iterator.ByteIterator in project eclipse-collections by eclipse.
the class AbstractImmutableByteHashSetTestCase method byteIterator.
@Override
@Test
public void byteIterator() {
MutableSet<Byte> expected = UnifiedSet.newSetWith((byte) 0, (byte) 1, (byte) 31);
MutableSet<Byte> actual = UnifiedSet.newSet();
ImmutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31);
ByteIterator iterator = set.byteIterator();
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, (Runnable) iterator::next);
}
Aggregations