you were doing the same with def list = [] then passing the same to each { ... }. Collect will create and build one collection