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