@SafeVarargs
  public static <E extends Exception>
  void runAllAndRethrowAllExceptions(@NotNull Class<? extends E> exampleClass,
                                     @NotNull Supplier<E> exampleSupplier,
                                     ThrowableRunnable<? extends Exception> @NotNull ... potentiallyFailingTasks) throws E {
    Function<List<? extends Throwable>, E> combiner = exceptions -> {
      E exception = null;
      for (Throwable e : exceptions) {
        if (exception == null) {
          if (exampleClass.isAssignableFrom(e.getClass())) {
            //noinspection unchecked
            exception = (E)e;
          }
          else {
            exception = exampleSupplier.get();
            exception.addSuppressed(e);
          }
        }
        else {
          exception.addSuppressed(e);
        }
      }
      return exception;
    };

    runAllAndRethrowAllExceptions(combiner, potentiallyFailingTasks);
  }
@SafeVarargs
  public static <E extends Exception>
  void runAllAndRethrowAllExceptions(@NotNull Class<? extends E> exampleClass,
                                     @NotNull Supplier<E> exampleSupplier,
                                     ThrowableRunnable<? extends Exception> @NotNull ... potentiallyFailingTasks)