There are many ways to do anything in Java, and there is no conclusive right way. Often, the right way is simply the way you know best. Imperative loops like the for loop are the most basic way to do ...
Conclusion Groovy provides concise and highly intuitive syntax for some of its collections implementations, but must make certain assumptions about the particular collection implementation to do this.