### Question:
ReadOnlyIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException("This is a read-only iterator"); } ReadOnlyIterator(Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove();  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void testIteratorPreventsModification() { remove(); }