public SpanNode getSpanNode() {
        if (spanNode != null && !spanNode.isValid()) {
            throw new IllegalStateException("Span node is invalid: " + spanNode);
        }
        return spanNode;
    }
Returns the {@link SpanNode} this Annotation is annotating, if any.

@return the {@link SpanNode} this Annotation is annotating, or null
@throws IllegalStateException if this Annotation is associated with a SpanNode and the SpanNode is invalid.
document/src/main/java/com/yahoo/document/annotation/Annotation.java