minor refactor (test robustness on Windows)
GROOVY-5934: java.lang.OutOfMemoryError through Iterator.collectEntries and others