SingletonPrimitiveIteratorOfLong implements PrimitiveIterator.OfLong { @Override public void remove() { throw new UnsupportedOperationException(); } SingletonPrimitiveIteratorOfLong(long element); @Override boolean hasNext(); @Override long nextLong(); @Override Long next(); @Override void remove(); @Override void forEachRemaining(LongConsumer action);  }
@Test void remove() { assertThrows(UnsupportedOperationException.class, instance::remove); }