static ItIt toIterator(ShortIterator it) { ret it == null ?: new ItIt { public bool hasNext() { ret it.hasNext(); } public Short next() { ret it.next(); } }; } static CloseableItIt toIterator(CloseableShortIterator it) { ret it == null ?: new CloseableItIt { close { pClose(it); } public bool hasNext() { ret it.hasNext(); } public Short next() { ret it.next(); } }; }