abstract the order-checking method out from different sort tests
implement 3-way quicksort and test