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