TreeNode[] getPathToRoot(TreeNode node, int depth)
Object[] getPathToRoot(Object node, int depth)
  TreeNode[] getPathToRoot(TreeNode node, int depth)  {    if (node == null)      {        if (depth == 0)          return null;                return new TreeNode[depth];      }    TreeNode[] path = getPathToRoot(node.getParent(), depth + 1);    path[path.length - depth - 1] = node;    return path;  }