最佳答案
What is the cleanest short way to get this done ?
class AnObject{
Long attr;
}
List<AnObject> list;
I know it can be done with custom comparator for AnObject
. Isn't there something ready out of the box for such case?
Kind of like this:
Collections.sort(list, X.attr);