Thats good for the first time. But We have data-table which are shown to the user. It has 10 columns. Now whenever the user clicks on any header we have to perform 5 level deep sorting. So its not only one time sorting but the list will be sorted on each click of the user.
So what you are actually doing is sorting on single properties multiple times? You can still do this with a Comparator, but you'll need to pass the properties you are sorting on to it as well. Because the sort is initiated by the user you will have to itertate back through the collection every time they click a property.