Originally posted by Nick Kocher: I wrote my own version, but I think there must be already such a method somethere in Collections and I want to use it.
There is no such API method that I am aware of, for it's certainly an odd thing to do to a Map/Properties (not that it couldn't be useful). Also, it has the problem that Stefan mentioned.
However, you can at least improve your method to iterate over the paired Map.Entry objects. I haven't looked at the Properties source, so I'm assuming it implements the Map interface. Finally, I recommend building a new Collection rather than modifying the one in-place.