static A mapMethodLike highestByField(S field, Collection l) { A best = null; O bestValue = null; if (l != null) for(A a : l) { O val = getOpt(a, field); if (val != null && (bestValue == null || cmp(val, bestValue) > 0)) { best = a; bestValue = val; } } ret best; } static A highestByField(Collection l, S field) { ret highestByField(field, l); }