title: Merging a List<HashMap<Obj1, Obj2>> as List<HashMap<Ob1, List<Obj2>>> in an efficient way?
body: <p>I have a data structure as </p>
  
  <pre><code>List&lt;HashMap&lt;Person, Address&gt;&gt;
  </code></pre>
  
  <p>I have a list from which I am getting the Person and Address objects. After I am done iterating over the given list, I need to merge the Address for each Person and get something as </p>
  
  <pre><code>List&lt;HashMap&lt;Person1, Address1&gt;&gt;
  List&lt;HashMap&lt;Person1, Address2&gt;&gt;
  List&lt;HashMap&lt;Person2, Address3&gt;&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>List&lt;HashMap&lt;Person, List&lt;Address&gt;&gt;&gt;
  </code></pre>
  
  <p>Is there any efficient way to get this done - may be having a different approach? Or iterating  the list is only option. And if the list contains a lot of data what would be the best option to treat it? </p>