static HashSet collectUnique(Collection c, S field) { new HashSet set; for (O a : c) { O val = getOpt(a, field); if (val != null) set.add(val); } ret set; } static HashSet mapMethodLike collectUnique(S field, Collection c) { ret collectUnique(c, field); }