Change for loops to better Java way of looping through a List.