examples/groovy/iterate_over_map_keys.groovy

def data = [
    name : 'Foo Bar',
    age : 42,
    email : 'zoo@bor.com',
]

println(data)

for (field in data.keySet()) {
   println(field)
}

my_keys = data.keySet()
println(my_keys.getClass())     // class java.util.LinkedHashMap$LinkedKeySet

If instead of iterating over the keys, you'd like to create an Array from the key, there is another example to convert the LinkedKeySet to and ArrayList.