Add test to check if throws exception on unsorted data