@Override
    public int compareTo(Annotation annotation) {
        int comp;

        if (spanNode == null) {
            comp = (annotation.spanNode == null) ? 0 : -1;
        } else {
            comp = (annotation.spanNode == null) ? 1 : spanNode.compareTo(annotation.spanNode);
        }

        if (comp != 0) {
            return comp;
        }

        comp = type.compareTo(annotation.type);

        if (comp != 0) {
            return comp;
        }

        // types are equal, too, compare values
        if (value == null) {
            comp = (annotation.value == null) ? 0 : -1;
        } else {
            comp = (annotation.value == null) ? 1 : value.compareTo(annotation.value);
        }

        return comp;
    }
Returns true if this Annotation has a value.

@return true if this Annotation has a value, false otherwise.
document/src/main/java/com/yahoo/document/annotation/Annotation.java