public static Object[] convertTreePathToArray(@NotNull TreePath path) {
    return convertTreePathToArray(path, object -> object, Object.class);
  }
public static Object[] convertTreePathToArray(@NotNull TreePath path)