private static @NotNull ArrayList<TreePath> toList(@NotNull Iterable<@NotNull TreePath> paths) {
      ArrayList<TreePath> pathList;
      if (paths instanceof Collection<TreePath> pathCollection) {
        pathList = new ArrayList<>(pathCollection);
      }
      else {
        pathList = new ArrayList<>();
        paths.forEach(pathList::add);
      }
      return pathList;
    }
private static @NotNull ArrayList<TreePath> toList(@NotNull Iterable<@NotNull TreePath> paths)