Groupingby a list of objects based on an attribute which can be null
问题 I have a list of Student Objects as below. Student1 DOB : 12/02/2010 Student2 DOB : 12/03/2010 Student1 DOB : 12/04/2010 Student4 DOB : Student2 DOB : Student3 DOB : 12/01/2010 Student{ String name; Date dob; } I want to group the Students based on the DOB as below. All Students should be grouped based on the student name. Students must be in descending order of dob. Same Students grouped together should be in descending order of dob. Remaining Student objects must be in same order as it is