Added test for the sortBy