### Question:
EmptyIterator implements Iterator<T>, Serializable { public void remove() { throw new IllegalStateException(UtilConstants.ERR_REMOVE_ON_EMPTY_ITR); }  boolean hasNext(); T next(); void remove();  }### Answer:
@Test public void remove() { EmptyIterator<Object> i = new EmptyIterator<>(); try { i.remove(); Assert.fail(); } catch (IllegalStateException e) { } }