Java tutorial
//package com.java2s; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; public class Main { public static <T extends Number> Long sum(List<Future<T>> list) throws InterruptedException, ExecutionException { long sum = 0; for (Future<T> each : list) { sum += each.get().longValue(); } return sum; } }