path.add(root);
    public static IvyNode getRoot(IvyNode parent) {        IvyNode root = parent;        while (root.getParent() != null) {            root = root.getParent();        }        return root;    }