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