title: How to convert List<Person> to Map<String, List<Double>> instead of Map<String, List<Person>>?
body: <p>Considering <code>Person</code> class has three fields name(String), age(int), salary(double).</p>
  
  <p>I want to create a map with name as key and value as salary (instead of <code>Person</code> object itself), if key is not unique then use linkedList to hold the values of all duplicate keys.</p>
  
  <p>I am referring to the solution given in the link given below:
  <a href="https://stackoverflow.com/questions/45567546/idiomatically-creating-a-multi-value-map-from-a-stream-in-java-8">Idiomatically creating a multi-value Map from a Stream in Java 8
  </a>  <strong>but still unclear how to create hashmap with Salary as value</strong>.</p>
  
  <p>I can create <code>map&lt;String, List&lt;Double&gt;&gt;</code> with forEach(). code is given below:</p>
  
  <pre><code>List&lt;Person&gt; persons= new ArrayList&lt;&gt;();
          persons.add(p1);
          persons.add(p2);
          persons.add(p3);
          persons.add(p4);
  
          Map&lt;String, List&lt;Double&gt;&gt; personsByName = new HashMap&lt;&gt;();
  
          persons.forEach(person -&gt;
              personsByName.computeIfAbsent(person.getName(), key -&gt; new LinkedList&lt;&gt;())
                      .add(person.getSalary())
          );
  </code></pre>
  
  <p>but I am trying to use "groupingBy &amp; collect" to create a map.
  If we want <code>Person</code> object itself as value then the code is given below:</p>
  
  <pre><code>Map&lt;String, List&lt;Person&gt;&gt; personsByNameGroupingBy = persons.stream()
                  .collect(Collectors.groupingBy(Person::getName, Collectors.toList()));
  </code></pre>
  
  <p>But I want to create a map with salary as value like given below:</p>
  
  <pre><code>Map&lt;String, List&lt;Double&gt;&gt; 
  </code></pre>
  
  <p>How to achieve this scenario?</p>