Here you can find the source of sumOfSquares(final double[] data)
public static Callable sumOfSquares(final double[] data)
//package com.java2s; import java.util.concurrent.*; public class Main { public static Callable sumOfSquares(final double[] data) { return new Callable() { int len = data.length; double sum = 0; public Object call() throws Exception { for (int i = 0; i < data.length; i++) { double temp = data[i]; sum += temp * temp;/*from www . ja v a2 s. c o m*/ } return sum; } }; } }