title: No suitable method found for groupingBy for List<String, Integer>
body: <p>Giving this code :   </p>
  
  <pre><code>List&lt;String&gt; list1 = Arrays.asList("Collect","Collection","by","Collectors");  
  Map&lt;String, Long&gt; map = list1.stream().collect(Collectors.groupingBy(list1::toString, Collectors.counting()));  
  System.out.println(map);  
  </code></pre>
  
  <p>It shows me : </p>
  
  <blockquote>
    <p>error: no suitable method found for
    groupingBy(list::toString,Collector&lt; Object,CAP#1,Long>)</p>
  </blockquote>
  
  <p>I know that if list1 was a  custom class that have let's say getName method and replace list1::toString by list1::getName it would work, but why not toString()?</p>