SingletonPrimitiveIteratorOfInt implements PrimitiveIterator.OfInt { @Override public int nextInt() { if (hasNext) { hasNext = false; return element; } throw new NoSuchElementException(); } SingletonPrimitiveIteratorOfInt(int e); @Override boolean hasNext(); @Override int nextInt(); @Override Integer next(); @Override void remove(); @Override void forEachRemaining(IntConsumer action);  }
@Test void nextInt() { assertEquals(ELEMENT, instance.nextInt()); }