Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement