Description
When sorting collection of objects, it is better to provide a specific Comparator to Collections.sort() API than to have the class of the object implement Comparable interface. It gives more flexibility of sorting and does not require more stringent requirements such as implementing hashCode() and equals() APIs for the object's class.