Here you can find the source of medianDouble(List
public static double medianDouble(List<Double> vals)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static double medianDouble(List<Double> vals) { List<Double> copy = new ArrayList<Double>(vals); Collections.sort(copy);/* w ww. j a v a2s . com*/ if (copy.size() % 2 == 0) { Double acc = copy.get(copy.size() / 2); acc += copy.get((copy.size() / 2) - 1); return acc / 2.0; } else { return copy.get(copy.size() / 2); } } }