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