title: Java 8 CompletableFuture.allOf(...) with Collection or List
body: <p>Java 8 has a function <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html#allOf-java.util.concurrent.CompletableFuture...-" rel="noreferrer"><code>CompletableFuture.allOf(CompletableFuture&lt;?&gt;...cfs)</code></a> that returns a <code>CompletableFuture</code> that is completed when all the given futures complete.</p>
  
  <p>However, I almost always am not dealing with an array of <code>CompletableFuture</code>s, but instead have a <code>List&lt;CompletableFuture&gt;</code>.  Of course, I can use the <code>toArray()</code> method, but this ends up being a bit of a pain to have to constantly convert back and forth between arrays and lists.   </p>
  
  <p>It would be really nice if there were a slick way get a <code>CompletableFuture&lt;List&lt;T&gt;&gt;</code> in exchange for a <code>List&lt;CompletableFuture&lt;T&gt;&gt;</code>, instead of constantly having to throw in an intermediary array creation. Does anyone know a way to do this in Java 8?</p>