Tests for sorting methods