Is this how to implement ascending sort when the comparator sorts descending?
// Sorts the emails alphabetically by subject in ascending order.
public void sortBySubjectAscending()
{
Collections.sort(emails, Collections.reverseOrder(new Email.SubjectDescendingComparator()));
}
Yes, it does. If you reverse a descending comparator, you get an ascending comparator.
To break it down, this is what you are doing: