public static double sum ( Collection < ? extends Number > values ) { double sum = 0d ; for ( Number n : values ) sum += n . doubleValue ( ) ; return sum ; }
Returns the sum of the collection of numbers