Is there a converter from List<CompletionStage> to CompletionStage<List> in Java?
问题 Like in this hypothetical example of using of : List<CompletionStage<Long>> listOfFutureLongs = getFutureLongs(...) CompletionStage<List<Long>> futureListOfLongs = CompletionStage.of(listOfFutureLongs) 回答1: Strangely no. There's CompletableFuture.allOf for CompletableFuture , which is kind of like what you want, but no similar function for CompletionStage . You can either use CompletionStage.toCompletableFuture to get futures, or you can write your own. Unfortunately, the inability to check a