public static < T > CompletableFuture < T > allOf ( List < CompletableFuture < T > > futures , BinaryOperator < T > reducer , T emptyValue ) { return allOf ( futures ) . thenApply ( resultList -> resultList . stream ( ) . reduce ( reducer ) . orElse ( emptyValue ) ) ; }
Returns a new CompletableFuture completed by reducing a list of computed values when all of the given CompletableFuture complete .