private ExplorerTreeNode addChild(final ExplorerTreeNode parent,
                                      final ExplorerTreeNode sibling,
                                      ExplorerTreeNode child,
                                      int orderIndex) {
        if (child == null) {
            throw new IllegalArgumentException("Node to add is null!");
        } else if (isPersistent(child) && exists(child)) {
            throw new IllegalArgumentException("Node is already part of tree: " + child);
        } else {
            assertInsertParameters(parent, sibling, orderIndex);
            boolean relatedNodeIsParent = parent != null;
            List<ExplorerTreePath> pathsToClone = new ArrayList<>();
            orderIndex = getPositionAndPathsToConnectSubTree(relatedNodeIsParent,
                    orderIndex,
                    parent,
                    sibling,
                    pathsToClone);
            if (!isPersistent(child)) {
                child = create(child);
            }

            insertSelfReference(child);
            clonePaths(child.getId(), 0, orderIndex, pathsToClone, relatedNodeIsParent);
            return child;
        }
    }
Get the root node containing a particular node, or the node itself if it is a root node.
stroom-explorer/stroom-explorer-impl-db/src/main/java/stroom/explorer/impl/db/ExplorerTreeDaoImpl.java