public static TreeNode toTreeNode(TreePath path) {
    Object component = path == null ? null : path.getLastPathComponent();
    return component instanceof TreeNode ? (TreeNode)component : null;
  }
public static TreeNode toTreeNode(TreePath path)