With a live template, you can generate for loops - 'fori' for indexed for loop and 'foreach' for iterating over collections.
And you can transform an indexed for loop to forEach and forEachOrdered loops. Further, you can reverse the loop, convert to while, and then to do while, change condition checks, remove parenthesis etc.
All this with context actions - invoke it with Alt + Enter and you can do all this magic!