code: public static CompletionStage<Void> allOf(CompletionStage<?>... stages) {
        AggregateCompletionStage<Void> aggregateCompletionStage = null;
        for (CompletionStage<?> stage : stages) {
           if (!isCompletedSuccessfully(stage)) {
              if (aggregateCompletionStage == null) {
                 aggregateCompletionStage = CompletionStages.aggregateCompletionStage();
              }
              aggregateCompletionStage.dependsOn(stage);
           }
        }
  
        return aggregateCompletionStage != null ? aggregateCompletionStage.freeze() : CompletableFutures.completedNull();
     }
docs: Returns a CompletionStage that completes when all of the provided stages complete, either normally or via
  exception. If one or more states complete exceptionally the returned CompletionStage will complete with the
  exception of one of these. If no CompletionStages are provided, returns a CompletionStage completed with the value
  null.
  @param stages the CompletionStages
  @return a CompletionStage that is completed when all of the given CompletionStages complete