@Test(expected = UnsupportedOperationException.class) public void testRemove() throws Exception { new ReadOnlyIterator() { @Override public boolean hasNext() { return true; } @Override public Object next() { return null; } }.remove(); }
@Override public void remove() { throw new UnsupportedOperationException(); }
ReadOnlyIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException(); } }
ReadOnlyIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException(); }  }
ReadOnlyIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException(); }  @Override void remove(); }
ReadOnlyIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException(); }  @Override void remove();  }