Use NaturalOrderComparator instead of built in Java one for strings.