private String transformQuery(String rawQuery) {
        CollapsePhraseSearcher searcher = new CollapsePhraseSearcher();
        Query query = new Query(rawQuery);
        new Execution(searcher, Execution.Context.createContextStub()).search(query);
        Item newRoot = query.getModel().getQueryTree().getRoot();
        if (newRoot != null)
            return newRoot.toString();
        else
            return null;
    }
Check CollapsePhraseSearcher works and only is triggered when it
should.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/querytransform/test/CollapsePhraseSearcherTestCase.java