code: public static Object getUserObjectFromTreePath(TreePath treePath)
      {
          if (treePath == null)
          {
              return null;
          }
          Object lastPathComponent = treePath.getLastPathComponent();
          return getUserObjectFromTreeNode(lastPathComponent);
      }
docs: Returns the user object from the last path component of the given tree
  path. If the given path is <code>null</code>, then <code>null</code>
  is returned. If the last path component is not a DefaultMutableTreeNode,
  then <code>null</code> is returned.
  
  @param treePath The tree path
  @return The user object