I have an object List, such as List < Main >, a property in Main is a Sub object, and an attribute id in Sub.
I want to sort by Main.Sub.id. What should I do?
list < Main > .stream (). Sorted (Comparator.comparing (Main::getSub)) cannot be sorted by id.