I have java POJO User which contains firstName of the user. There is a map which contains the list of users mapped against the school name. Something like the below
class User{
String name;
}
class UserMap{
Map<String,List<User> userMapOfSchool;
public String toString(){
//return "schoolName has noOfStudents" for each key in the map
}
}
As mentioned above in the toString() method, I wanted to print the list school name and the number of students in the school. How can I do that in Java 8?