iterator to for loop in Test.java