Added comparator to the collection to sort by id.