Groovy has more ways of looping besides supporting the Java iterations.
Groovy extends the
Integer class with the
times() methods. These methods take a closure as a parameter. In the closure we define the piece of code we want to be executed several times.
It also adds
eachWithIndex() methods to iterate over collections.