If we have the List, Map or any other collection object we sort by using calling Collections.sort() method directly. But if we have our custom object we have to do some extra to sort our custom object. Assume that we have one Person Object like below
class Person{
int id;
String name;
Setter…
Getter…
}
class Person{
int id;
String name;
Setter…
Getter…
}



