sort with comparator function test