There are a number of ways to satisfy your requirement. As you have subsequently clarified that you may have duplicate objects in your current TreeMap, perhaps you could replace your TreeMap with a third-party multimap (Guava, Apache Commons Collections), then swap your keys and values around - i.e. replace TreeMap with Multimap. Depending on the details of your situation I believe this stands a good chance of working for you.