static A highestByFunction(Iterable l, O f) { A best = null; O bestValue = null; if (l != null) for (A a : l) { O val = callF(f, a); if (best == null || cmp(val, bestValue) > 0) { best = a; bestValue = val; } } ret best; }