Here you can find the source of sumAll(List extends Number> list)
public static long sumAll(List<? extends Number> list)
//package com.java2s; import java.util.List; public class Main { public static long sumAll(List<? extends Number> list) { long sum = 0L; for (Number item : list) { sum = sum + item.longValue(); }// w ww. j a va 2 s. c o m return sum; } }