private static boolean pathContains(TreePath path, PackagingElementNode<?> node, LayoutTree tree) {
    while (path != null) {
      final SimpleNode pathNode = tree.getNodeFor(path);
      if (pathNode == node) {
        return true;
      }
      path = path.getParentPath();
    }
    return false;
  }
private static boolean pathContains(TreePath path, PackagingElementNode<?> node, LayoutTree tree)