public static double sum(List<? extends Number> list){
double sum = 0;
for(Number n : list){
sum += n.doubleValue();
}
return sum;
}
иpublic static <T extends Number> double sum(List<T> list){
double sum = 0;
for(Number n : list){
sum += n.doubleValue();
}
return sum;
}