static Iterator getIterator(O o) { if (o instanceof Iterator) ret (Iterator) o; if (o instanceof Iterable) ret ((Iterable) o).iterator(); fail("Can't convert to iterator: " + className(o)); }