SHARE
TWEET

Untitled

a guest Aug 19th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.List;
  2. import java.util.Map;
  3.  
  4. public class GroupByKey {
  5.  
  6.     static Map<String, List<Person>> groupByFirstName(List<Person> persons) {
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.     }
  35.  
  36.     static class Person {
  37.         int id;
  38.         String firstName;
  39.         String secondName;
  40.         int age;
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top