Reversing a HashMap <String, Object> to different Sets and/or Lists
===

I will try to explain the point that I am stuck as simple as I can.

Basically I am trying to implement a solution to handle user data. 

I have a Map something like <String, Object>, which will store user ids as keys and user objects as values. User object has some fields like location, name, age etc. etc. 

By using the map, I would like to have some sets or other maps to classify user data. For instance i am trying to get another map like <String, Set<String>> which will store a set of users who lives in the same location and so on. 

I have tried some tricks as well as checked some links like [this][1] and [this][2] and some others, also tried to implement some basic code for reversing 

        Set<String> userid = new HashSet<String>();
    Map<String, Set<String>> returnvalue = new HashMap<String, Set<String>>();
    HashMap<String, String> userReason = convertForReason();
    for (Entry<String, String> entry : userReason.entrySet()) {
        userid.add(entry.getKey());
    }



but i am stuck how to create the new map <String. Set<String>>, any ideas how to achieve this? or other solutions for this kind of issues?

  [1]: http://www.codingforums.com/showthread.php?t=191502
  [2]: http://stackoverflow.com/questions/7549640/reversing-a-hashmap-from-mapstring-boolean-to-mapboolean-liststring