Java 8 CompletableFuture.allOf(…) with Collection or List [duplicate]
This question already has an answer here: List<Future> to Future<List> sequence 8 answers Java 8 has a function CompletableFuture.allOf(CompletableFuture<?>...cfs) that returns a CompletableFuture that is completed when all the given futures complete. However, I almost always am not dealing with an array of CompletableFuture s, but instead have a List<CompletableFuture> . Of course, I can use the toArray() method, but this ends up being a bit of a pain to have to constantly convert back and forth between arrays and lists. It would be really nice if there were a slick way get a