public static void joinAll(@NotNull Collection<? extends Thread> threads) throws RuntimeException {
    for (Thread thread : threads) {
      try {
        thread.join();
      }
      catch (InterruptedException e) {
        throw new RuntimeException(e);
      }
    }
  }
public static void joinAll(@NotNull Collection<? extends Thread> threads)