As ArrayLists don't keep a naturalWhen you insert into an ArrayList the "natural" ordering of the types is not accounted for as such the List will not be in alphabetical order beforebut in the order you put the data in. Before you return you will have to call Collections.sort() which will order each string in alphabetical order