private boolean removeMarkupAnnotation(SpanTree tree, SpanNode node) {
        //get iterator over all annotations on this node:
        Iterator<Annotation> annotationIt = tree.iterator(node);

        while (annotationIt.hasNext()) {
            Annotation annotation = annotationIt.next();
            if (annotation.getType().getName().equals("markup")) {
                //this node has an annotation of type markup, remove it:
                annotationIt.remove();
                //return true, this node had a markup annotation:
                return true;
            }
        }
        //this node did not have a markup annotation:
        return false;
    }
Removes annotations of type 'markup' from the given node.

@param tree the tree to remove annotations from
@param node the node to remove annotations of type 'markup' from
@return true if the given node had 'markup' annotations, false otherwise
document/src/test/java/com/yahoo/document/annotation/DocTestCase.java