Refactor sort test methods.