@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SpanNode spanNode)) return false;

        if (getFrom() != spanNode.getFrom()) return false;
        if (getTo() != spanNode.getTo()) return false;

        return true;
    }
Checks if the text covered by another span is within the text covered by this span.

@param o the other SpanNode to check.
@return true if the text covered by another span is within the text covered by this span, false otherwise.
document/src/main/java/com/yahoo/document/annotation/SpanNode.java