static int indexOfMax(L l, IF1 f) { new Best_comparable best; for i over l: best.put(i, f.get(l.get(i))); ret or(best!, -1); }