一切福田,不離方寸,從心而覓,感無不通。
public void groupingByCity() { Map> map = employees.stream().collect(Collectors.groupingBy(Employee::getCity)); map.forEach((k, v) -> { System.out.println(k + " = " + v); }); }
Copyright © 2024 Longsheng All rights reserved