[java] how to get the one entry from hashmap without iterating