// does not store null values static MultiMap multiMapIndexByMethod(Collection c, S method, O... args) { new MultiMap map; for (O a : c) { O val = callOpt(a, method, args); if (val != null) map.put(val, a); } ret map; }