public void move(SpanNode node, AlternateSpanList target, int targetSubTree) {
        if (targetSubTree < 0 || targetSubTree >= target.getNumSubTrees()) {
            throw new IndexOutOfBoundsException(target + " has no subtree at index " + targetSubTree);
        }
        boolean removed = children().remove(node);
        if (removed) {
            //we found the node
            node.setParent(null);
            resetCachedFromAndTo();
            target.add(targetSubTree, node);
        } else {
            throw new IllegalArgumentException("Node " + node + " is not a child of this SpanList, cannot move.");
        }
    }
Moves a child of this SpanList to another SpanList.

@param node the node to move
@param target the SpanList to add the node to
@param targetSubTree the index of the subtree of the given AlternateSpanList to add the node to
@throws IllegalArgumentException if the given node is not a child of this SpanList
@throws IndexOutOfBoundsException if the target subtree index is out of range
document/src/main/java/com/yahoo/document/annotation/SpanList.java