Here you can find the source of getMean(Collection
public static double getMean(Collection<Double> data)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static double getMean(Collection<Double> data) { double sum = 0.0; for (double d : data) { sum += d;/*w ww . j a v a2s.c o m*/ } return sum / data.size(); } }