All the strings in the lists are compared, using the String.compareTo, and the minimum value is returned.