EmptyIterator implements Iterator { @Override public void remove() { throw new IndexOutOfBoundsException(); }  @Override boolean hasNext(); @Override Object next(); @Override void remove(); static final EmptyIterator INSTANCE; }
@Test(expectedExceptions = IndexOutOfBoundsException.class) public void testRemove() { EmptyIterator.INSTANCE.remove(); }