Here you can find the source of sum(final double[] a)
public static Callable sum(final double[] a) throws Exception
//package com.java2s; import java.util.concurrent.*; public class Main { public static Callable sum(final double[] a) throws Exception { Callable c = new Callable() { public Object call() throws Exception { Double max = null; double[] result = new double[a.length]; max = a[0];/*from w w w .ja v a2s . c o m*/ for (int i = 1; i < a.length; i++) { max += a[i]; } return max; } }; return c; } }