We have a map of Student to record Map<Student, StudentRecord>.
Student class is as follows:
Student {
String id;
String grade;
Int age;
}
Additionally, we have a list of Student Id (List<String>) provided.
Using Java streams, what would be the most efficient way to filter out records of students whose Id exists in the provided list?
The expected outcome is the filtered list mapped against the Id(String) - <Map<Id, StudentRecord>>
Map<Student,StudentRecord>, how come the output is aList<Map<Student,StudentRecord>>? Shouldn't the output be aMap<Student,StudentRecord>where some of the entries are filtered out?