Sorts (and purges) a generic array using natural ordering.
Sorts (and purges) a generic array using a custom comparator.