static bool allDifferent(Iterable l) { if (l == null) true; new HashSet set; for (A a : l) if (!set.add(a)) false; true; }