public static <T>CompletableFuture<T> waitForAll(List<CompletableFuture<T>> futures){
  if (futures.isEmpty()) {
    return CompletableFuture.completedFuture(null);
  }
  final CompletableFuture<T> compositeFuture=new CompletableFuture<>();
  final AtomicInteger count=new AtomicInteger(futures.size());
  final AtomicReference<Throwable> exception=new AtomicReference<>();
  for (  CompletableFuture<T> future : futures) {
    future.whenComplete(null);
  }
  return compositeFuture;
}

public static < T > CompletableFuture < T > waitForAll ( List < CompletableFuture < T > > futures ) { if ( futures . isEmpty ( ) ) { return CompletableFuture . completedFuture ( null ) ; } final CompletableFuture < T > compositeFuture = new CompletableFuture < > ( ) ; final AtomicInteger count = new AtomicInteger ( futures . size ( ) ) ; final AtomicReference < Throwable > exception = new AtomicReference < > ( ) ; for ( CompletableFuture < T > future : futures ) { future . whenComplete ( null ) ; } return compositeFuture ; }
return a future that represents the completion of the futures in the provided list
