title: Differences between Collectors.toMap() and Collectors.groupingBy() to collect into a Map
body: <p>I want to create a <code>Map</code> from a <code>List</code> of <code>Points</code> and have inside the map all entries from the list mapped with the same parentId such as <code>Map&lt;Long, List&lt;Point&gt;&gt;</code>.<br>
  I used <code>Collectors.toMap()</code> but  it doesn't compile :</p>
  
  <pre><code>Map&lt;Long, List&lt;Point&gt;&gt; pointByParentId = chargePoints.stream()
      .collect(Collectors.toMap(Point::getParentId, c -&gt; c));
  </code></pre>