title: java stream Collectors.groupingBy() multiple fields
body: <pre><code>Stream&lt;Map.Entry&lt;String, Long&gt;&gt; duplicates = notificationServiceOrderItemDto.getService()
      .getServiceCharacteristics()
      .stream()
      .collect(
          Collectors.groupingBy(
              ServiceCharacteristicDto::getName, Collectors.counting()
          )
       )
       .entrySet()
       .stream()
       .filter(e -&gt; e.getValue() &gt; 1);
  
  Optional&lt;String&gt; dupName = duplicates.map(Map.Entry::getKey).findFirst();
  </code></pre>
  
  <p>works perfect. But I wold like to find duplicates not just with name but also name + value + key</p>
  
  <blockquote>
    <p>That means if name + value + key is the same this is duplicate.</p>
  </blockquote>
  
  <p>I am looking Collectors.groupingBy() </p>
  
  <p><a href="http://www.technicalkeeda.com/java-8-tutorials/java-8-stream-grouping" rel="nofollow noreferrer">http://www.technicalkeeda.com/java-8-tutorials/java-8-stream-grouping</a></p>
  
  <p>but I can not find correct solution</p>