static bool allElementsEqual(Iterable l) { if (l == null) true; Iterator it = iterator(l); if (!it.hasNext()) true; A a = it.next(); while ping (it.hasNext()) { if (!eq(a, it.next())) false; } true; }