Hi Bukkit. I'm currently into developing my first plugin and I wonder if you could help me with kind of 'looping' through HashMaps. I currently have a HashMap consisting of the key as an Integer and a String as the value. When a player types a specific command the argument he typed will be set as the value of the next available integer (as the key). Therefore, I want to have some sort of loop, when the command-executor is run, that loops through the HashMap and reports, or chooses, the next available Integer that is not 'occupied' as any key. For example: My HashMap consists of key '1' and its value. When the command is run, I don't want to put the argument of the command to a specific key but to key '2' because key '1' is occupied. If my HashMap consists of key '1' and '2' I want to put the argument to key '2' because it's the next available. If my HashMap consists of key '1' '2' '3' and '5' I want to put the argument to key '4' because it's the next available. I do not need help with putting the argument of the command to the HashMap, only how to loop through the HashMap until the next available Integer is found. I was thinking that maybe I could use a loop that does ++ until containsKey is null, then reports back that Integer in an int that later on can be used to set the key. I hope you understand what I mean and can help me. Thanks.