static int iteratorCount_int_close(Iterator i) ctex { int n = 0; if (i != null) while (i.hasNext()) { i.next(); ++n; } if (i cast AutoCloseable) i.close(); ret n; }