code: private static Object getParent(
          TreeModel treeModel, Object node, Object potentialParent)
      {
          List<Object> children = getChildren(treeModel, potentialParent);
          for (Object child : children)
          {
              if (child == node)
              {
                  return potentialParent;
              }
              Object parent = getParent(treeModel, node, child);
              if (parent != null)
              {
                  return parent;
              }
          }
          return null;
      }
docs: Returns the parent of the given node in the given tree model.
  This parent may be <code>null</code>, if the given node is
  the root node (or not contained in the tree model at all).
  
  @param treeModel The tree model
  @param node The node
  @param potentialParent The potential parent
  @return The parent