// does not store null values static MultiMap lambdaMapLike treeMultiMapIndex(IF1 f, Iterable l) { new TreeMultiMap map; fOr (A a : l) { B val = f.get(a); if (val != null) map.put(val, a); } ret map; } static MultiMap lambdaMapLike treeMultiMapIndex(Iterable l, IF1 f) { ret treeMultiMapIndex(f, l); }