Refactored sort tests.