@Override
    public void set(E e) {
        if (position < 0) {
            //we have not next'ed the iterator, cannot do this:
            throw new IllegalStateException("Cannot set() before next()");
        }
        if (next != null) {
            //we have already gone one step ahead. must back up two positions and then remove:
            base.previous();
            base.previous();
        }
        base.set(e);
        next = null;

    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/main/java/com/yahoo/document/annotation/PeekableListIterator.java