static long iteratorCount(Iterator i) { long n = 0; while (i.hasNext()) { i.next(); ++n; } ret n; }