This is a tricky one. When you use a for-each-loop,
Java creates copies of the objects that you manipulate. That means, that you don't really create new objects in your first loop (well, you do, but they don't go into the array).
You should try this with an old-fashioned for loop with a counter variable.