private String transform(String sorting, String language) {
        String q = "/?query=a";
        if (sorting != null) {
            q += "&sorting=" + sorting;
        }
        if (language != null) {
            q += "&language=" + language;
        }
        new Query(q);
        Result r = doSearch(searcher, new Query(q), 0, 10);
        if (r.hits().getError() != null) {
            return null;
        }
        if (r.getQuery().getRanking().getSorting() == null) {
            return "";
        }
        return r.getQuery().getRanking().getSorting().fieldOrders().toString();
    }
Check sorting validation behaves OK.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java