title: Convert List<Person> to Map<Integer, List<Integer>> using Lambdas
body: <p>I wanted to convert list to Map as below. Here is the example.</p>
  
  <p>I have student list something like below code snippet. Get a Hasmap out of it with Key as Integer which is Age and value as List. </p>
  
  <p>From the below input feed, My response should be something like below. How do I achieve this ?</p>
  
  <p>Map[[10, {1}], [20, {2,3,4}], [30,{5}]. [40,{6}]];</p>
  
  <pre><code>private static List&lt;Person&gt; getPersonTestData() {
      List&lt;Person&gt; personList = new ArrayList&lt;&gt;();
      personList.add(Person.of(1, "First1", "Last1", 10));
      personList.add(Person.of(2, "First2", "Last2", 20));
      personList.add(Person.of(3, "First3", "Last3", 20));
      personList.add(Person.of(4, "First4", "Last4", 20));
      personList.add(Person.of(5, "First5", "Last5", 30));
      personList.add(Person.of(6, "First6", "Last6", 40));
  
      return personList;
  }
  </code></pre>
  
  <p>Thanks In Advance.......!</p>