private static IdentityHashMap<SpanNode, Integer> getSpanNodes(SpanTree otherToCopy) {
        IdentityHashMap<SpanNode, Integer> map = new IdentityHashMap<>();
        int spanNodeCounter = 0;
        map.put(otherToCopy.getRoot(), spanNodeCounter++);
        Iterator<SpanNode> it = otherToCopy.getRoot().childIteratorRecursive();
        while (it.hasNext()) {
            map.put(it.next(), spanNodeCounter++);
        }
        return map;
    }
Creates a new SpanTree with the given name and an empty SpanList as its root node.

@param name the name of the span tree
document/src/main/java/com/yahoo/document/annotation/SpanTree.java