@Test
    void testSortSpec() {
        Query q = newQuery("?query=test&sortspec=+a -b c +[rank]");
        assertNotNull(q.getRanking().getSorting());
        List<Sorting.FieldOrder> sortSpec = q.getRanking().getSorting().fieldOrders();
        assertEquals(sortSpec.size(), 4);
        assertEquals(Sorting.Order.ASCENDING, sortSpec.get(0).getSortOrder());
        assertEquals("a", sortSpec.get(0).getFieldName());
        assertEquals(Sorting.Order.DESCENDING, sortSpec.get(1).getSortOrder());
        assertEquals("b", sortSpec.get(1).getFieldName());
        assertEquals(Sorting.Order.UNDEFINED, sortSpec.get(2).getSortOrder());
        assertEquals("c", sortSpec.get(2).getFieldName());
        assertEquals(Sorting.Order.ASCENDING, sortSpec.get(3).getSortOrder());
        assertEquals("[rank]", sortSpec.get(3).getFieldName());
    }
Test that the integer convenience wrapper works as documented,
throwing NumberFormatException when applied to something that
is not a number.
container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java