Change to Java 5 loop syntax