static double getAverage(L l, S field) { double sum = 0; for (O x : l) sum += toDouble(get(x, field)); ret sum/l(l); }