Computing: class Foo { doSomething() { data = "James", "location": "London" for (e in data) { println("entry ${e.key} is ${e.value}") } } closureExample(collection) { collection.each { println("value ${it}") } } static void main(args) { values = 2, 3, "abc" foo = new Foo() foo.closureExample(values) foo.doSomething() } }