private void clonePaths(final Integer childId,
                            final int addToDepth,
                            final int position,
                            final List<ExplorerTreePath> pathsToClone,
                            final boolean isParentPaths) {
        for (final ExplorerTreePath pathToClone : pathsToClone) {
            final int depth = pathToClone.getDepth() + addToDepth + (isParentPaths
                    ? 1
                    : 0);
            final int newPosition = depth == 1
                    ? createGap(isParentPaths
                    ? pathToClone.getDescendant()
                    : pathToClone.getAncestor(), position)
                    : -1;
            final ExplorerTreePath newPath = new ExplorerTreePath(
                    pathToClone.getAncestor(),
                    childId,
                    depth,
                    newPosition);
            create(newPath);
        }
    }
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