Here you can find the source of mean(List extends Number> data)
public static double mean(List<? extends Number> data)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Gabriel Skantze./* ww w. ja v a 2 s . c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * Gabriel Skantze - initial API and implementation ******************************************************************************/ import java.util.List; public class Main { public static double mean(List<? extends Number> data) { double mean = 0; for (Number pd : data) { mean += pd.doubleValue() / data.size(); } return mean; } }