@Override
    public int compareTo(FieldValue fieldValue) {
        int comp = super.compareTo(fieldValue);
        if (comp == 0) {
            //types are equal, this must be of this type
            AnnotationReference value = (AnnotationReference) fieldValue;
            if (reference == null) {
                comp = (value.reference == null) ? 0 : -1;
            } else {
                comp = (value.reference == null) ? 1 : (reference.toString().compareTo(value.reference.toString()));
            }
        }
        return comp;
    }
WARNING!&nbsp;Only to be used by deserializers when reference is not fully deserialized yet!&nbsp;Sets
an {@link Annotation} that this AnnotationReference shall refer to.

@param reference an Annotation that this AnnotationReference shall refer to.
@throws IllegalArgumentException if the given annotation has a type that is not compatible with this reference
document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java