private SpanTree getNonNullSpanTree() {
        SpanTree spanTree = getSpanTree();
        if (spanTree == null)
            throw new NullPointerException(this + " is not attached to a SpanTree through its parent yet");
        return spanTree;
    }
Returns the SpanTree this belongs to and throws a nice NullPointerException if none
document/src/main/java/com/yahoo/document/annotation/SpanNode.java