Group the map values to avoid duplicate : <p>I have a Map(map1) whose key is another map(map2) and value is string.</p>

<p>The value of map1 has several duplicate, so I must group them and set as key in another map3 whose value has to be map2.</p>

<pre><code>eg:

map1 {  [[a,b],xyz],  [[c,d],wrt] , [[e,f],xyz] , [[r,m],xyz]  }


output should be :

map3 {  [ xyz,[ [a,b],[e,f],[r,m] ] ]  , [ wrt,[ [c,d] ]
</code></pre>

<p>can i obtain like this ?</p>
