title: using java 8 groupBy with conditions
body: <ol>
  <li><p>Group by number to find groups with size bigger then 1
      2. Check if a group contains a condition (string !=null)</p>
  
  <pre><code>2a. if yes ---&gt; remove all rows which do not have a condition (string == null)
  2b. if no ---&gt; return the group as it is (no filtering at all)
  </code></pre></li>
  </ol>
  
  <p>I am trying below code but I am not able to filter the condition here. Is there any simple way to do it?</p>
  
  <pre><code>groupByList = list.stream().collect(Collectors.groupingBy(student::no));
  groupByList.values().stream().map(group -&gt; group.size() &gt; 1)
                   .collect(Collectors.toList());
  </code></pre>