SingletonPrimitiveIteratorOfInt implements PrimitiveIterator.OfInt { @Override public void remove() { throw new UnsupportedOperationException(); } SingletonPrimitiveIteratorOfInt(int e); @Override boolean hasNext(); @Override int nextInt(); @Override Integer next(); @Override void remove(); @Override void forEachRemaining(IntConsumer action);  }
@Test void remove() { assertThrows(UnsupportedOperationException.class, instance::remove); }