Added tests for the sorting related methods