docs: public static <T> TreePath findPathFromEnclosingNodeToTopLevel(TreePath path, Class<T> klass) {
      if (path != null) {
        do {
          path = path.getParentPath();
        } while (path != null && !(klass.isInstance(path.getLeaf())));
      }
      return path;
    }