private void removeAnnotationReferencesThatPointToRemovedAnnotations() {
        if (hasAnyFieldValues()) {
            Map<Annotation, Annotation> annotationsStillPresent = new IdentityHashMap<Annotation, Annotation>();
            for (Annotation a : this) {
                annotationsStillPresent.put(a, a);
            }
            for (Annotation a : this) {
                if (!a.hasFieldValue()) {
                    continue;
                }
                //do we have any references to annotations that are NOT in this global list??
                removeObsoleteReferencesFromFieldValue(a.getFieldValue(), annotationsStillPresent, false);
            }
        }
    }
Ensures consistency of the tree in case SpanNodes have been removed, and there are still
Annotations pointing to them. This method has a maximum upper bound of O(3nm), where n is the
total number of Annotations, and m is the number of SpanNodes that had been removed from the tree.
The lower bound is Omega(n), if no SpanNodes had been removed from the tree.
document/src/main/java/com/yahoo/document/annotation/SpanTree.java