Here you can find the source of mean(List
public static double mean(List<Double> values)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static double mean(List<Double> values) { double sum = 0; for (Double val : values) { sum += val; }/*w w w . j a v a2 s . c o m*/ return sum / values.size(); } }