SingletonPrimitiveIteratorOfLong implements PrimitiveIterator.OfLong { @Override public long nextLong() { if (hasNext) { hasNext = false; return element; } throw new NoSuchElementException(); } SingletonPrimitiveIteratorOfLong(long element); @Override boolean hasNext(); @Override long nextLong(); @Override Long next(); @Override void remove(); @Override void forEachRemaining(LongConsumer action);  }
@Test void nextInt() { assertEquals(ELEMENT, instance.nextLong()); }