title: How to filter the age while grouping in map with list
body: <p>Similar to my previous question <a href="https://stackoverflow.com/questions/53845355/create-a-sorted-set-while-using-streams">here</a>, the <strong>User</strong> objects I have are these</p>
  
  <pre><code>new User("ayush","admin",23)
  new User("ashish","guest",19) 
  new User("ashish","admin",20) 
  new User("garima","guest",29)
  new User("garima","super",45)
  new User("garima","guest",19)
  </code></pre>
  
  <p>Now I am trying to get the name to varying ages trend for these users. But I need to filter them above a <code>threshold</code> age. I could get the trend using </p>
  
  <pre><code>Map&lt;String, List&lt;Integer&gt;&gt; userNameAndAgeTrend = users.stream().collect(Collectors.groupingBy(user-&gt; user.getName(), Collectors.mapping(u-&gt; u.getAge(), toList())));
  </code></pre>
  
  <p>this gives me <code>{ashish=[19, 20], garima=[29, 45, 19], ayush=[23]}</code>. But I am unable to filter the List properly using threshold for example <strong>21 years</strong> in my situation using such grouping. Can someone please help?</p>
  
  <p>Also, using <code>.filter(user -&gt; user.getAge() &gt; 21)</code> gives no mapping for ashish, which is what I want to store too. I can use Java10 installed on my machine and trying the suggested solutions.</p>