@Override
    public boolean hasNext() {
        if (stack.isEmpty()) {
            return false;
        }
        PeekableListIterator<SpanNode> iterator = stack.peek();
        if (!iterator.hasNext()) {
            stack.pop();
            return hasNext();
        }
        return true;
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/main/java/com/yahoo/document/annotation/SerialIterator.java