public static void collapsePaths(@NotNull JTree tree, @Nullable Iterable<TreePath> paths) {
    if (paths == null) {
      return;
    }
    if (Tree.isBulkExpandCollapseSupported() && tree instanceof Tree jbTree) {
      jbTree.collapsePaths(paths);
    }
    else {
      paths.forEach(tree::collapsePath);
    }
  }
public static void collapsePaths(@NotNull JTree tree, @Nullable Iterable<TreePath> paths)