private void assertCanonicalized(String canonicalForm, String expectedError, Query query) {
        String error = QueryCanonicalizer.canonicalize(query);

        assertEquals(expectedError, error);
        if (canonicalForm == null) {
            assertNull(query.getModel().getQueryTree().getRoot());
        } else {
            assertEquals(canonicalForm, query.getModel().getQueryTree().getRoot().toString());
        }
    }
Tests that significance is transferred to rank properties by preparing the query
(which strictly is an implementation detail which we should rather hide).
container-search/src/test/java/com/yahoo/prelude/query/test/QueryCanonicalizerTestCase.java