if (root == null || node == null)
if (root == null || node == null || root.equals(node))
  Object getParent(Object root, Object node)  {    if (root == null || node == null)      return null;    if (node instanceof TreeNode)      return ((TreeNode) node).getParent();    return findNode(root, node);  }