'while' loop can be replaced with enhanced 'for' loop
while loops that iterate over collections and can be replaced with enhanced
for loops (foreach iteration syntax).
Can be replaced with:
This inspection only reports if the language level of the project or module is 5 or higher.
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3