Here you can find the source of mean(List
public static double mean(List<Double> a)
//package com.java2s; // under certain conditions; for more information please see LICENSE.txt import java.util.*; public class Main { public static double mean(List<Double> a) { double sum = sum(a); double mean = 0; mean = sum / (a.size() * 1.0);/*ww w .j ava 2 s.c o m*/ return mean; } public static double sum(List<Double> a) { if (a.size() > 0) { double sum = 0; for (Double i : a) { sum += i; } return sum; } return 0; } }