java foreachs are weird