@Override
    public void remove() {
        if (returnedFromNext != null) {
            returnedFromNext.setInvalid();
            returnedFromNext.setParent(null);
            owner.resetCachedFromAndTo();
        }
        returnedFromNext = null;
        base.remove();
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/main/java/com/yahoo/document/annotation/InvalidatingIterator.java