public static @Nullable <T> T findObjectInPath(@Nullable TreePath path, @NotNull Class<T> clazz) {
    while (path != null) {
      T object = getLastUserObject(clazz, path);
      if (object != null) return object;
      path = path.getParentPath();
    }
    return null;
  }
public static @Nullable <T> T findObjectInPath(@Nullable TreePath path, @NotNull Class<T> clazz)