public static < T > List < T > collectFutures ( Collection < Future < T > > futures ) throws ExecutionException , InterruptedException { ArrayList < T > collected = new ArrayList < T > ( futures . size ( ) ) ; for ( Future < T > future : futures ) collected . ( future . get ( ) ) ; return collected ; }
Collects all future values in a collection into a list and returns said list . This method will block until all future objects are collected .