Here you can find the source of getAll(List
public static <T> List<T> getAll(List<Future<T>> futures)
//package com.java2s; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Future; public class Main { public static <T> List<T> getAll(List<Future<T>> futures) { try {//from w w w . j a v a2 s . c o m List<T> result = new ArrayList<T>(futures.size()); for (Future<T> future : futures) { result.add(future.get()); } return result; } catch (Exception e) { throw new RuntimeException( "Exception while getting result of multiple futures", e); } } }