Check the java docs for Collections.sort(). It does not work on a Collection even though you instantiated it as an ArrayList. You should declare it as a List instead of Collection.