Source:http://stackoverflow.com/questions/2784514/sort-arraylist-of-custom-objects-by-propertyClassesthathasanaturalsortorder(aclassNumber,asanexample)shouldimplementtheComparableinterface,whilstclassesthathasnonaturalsortorder(aclassChair,asanexample)shouldbeprovidedwithaComparator(orananonymousComparatorclass).Twoexamples:publicclassNumberimplementsComparable<Number>{privateintvalue;pu ...