private static boolean isLooped(TreePath path, DefaultMutableTreeNode child) {
        for (Object o : path.getPath()) {
          DefaultMutableTreeNode node = (DefaultMutableTreeNode)o;
          if (node != child && Comparing.equal(node.getUserObject(), child.getUserObject())) {
            return true;
          }
        }
        return false;
      }
private static boolean isLooped(TreePath path, DefaultMutableTreeNode child)