问题 Imagine a situation like this: I have a HashMap<Integer, String> , in which I store the connected clients. It is HashMap , because the order does not matter and I need speed. It looks like this: { 3: "John", 528: "Bob", 712: "Sue" } Most of the clients disconnected, so this is why I have the large gap. If I want to add a new client, I need a key and obviously the usage of _map.size() to get a key is incorrect. So, currently I use this function to get he lowest available key: private int