public static void restoreExpandedPaths(final @NotNull JTree tree, final @NotNull List<? extends TreePath> paths){
    if (isBulkExpandCollapseSupported(tree)) {
      //noinspection unchecked
      ((Tree)tree).expandPaths((Iterable<TreePath>)paths);
    }
    else {
      for (int i = paths.size() - 1; i >= 0; i--) {
        tree.expandPath(paths.get(i));
      }
    }
  }
public static void restoreExpandedPaths(final @NotNull JTree tree, final @NotNull List<? extends TreePath> paths)