@Override public void remove() { if (!canremove) { throw new IllegalStateException( "remove() can only be called " + "on the FilterIterator immediately after a successful " + "call to next(). A call to remove() immediately after " + "a call to hasNext() or remove() will also fail."); } canremove = false; iterator.remove(); }