private static @NotNull Runnable indicatorCancellation(@NotNull ProgressIndicator progressIndicator) {
    return () -> {
      if (!progressIndicator.isCanceled()) {
        progressIndicator.cancel();
      }
    };
  }
private static @NotNull Runnable indicatorCancellation(@NotNull ProgressIndicator progressIndicator)