static ItIt iterateUpdatingProgressShower(IProgressShower progressBar, Collection l) { if (progressBar == null) ret iterableIterator(l); ret iteratorFromFunction_withEndMarker_f0(new F0 { int n = l(l), i; Iterator it = iterator(l); NotTooOften nto = onlyTenTimesASecond(); { progressBar.setTotal(n); } void update { progressBar.setValue(i); progressBar.setText(i + " / " + n); } public O get() { if (!it.hasNext()) { i = n; update(); ret endMarker(); } if (nto.yo()) update(); ++i; ret it.next(); } }); }