@Test
    final void testConvertStringToQTree() {
        Execution placeholder = new Execution(Context.createContextStub());
        SpecialTokenRegistry tokenRegistry = new SpecialTokenRegistry(
                new SpecialtokensConfig(
                        new SpecialtokensConfig.Builder()
                                .tokenlist(new Tokenlist.Builder().name(
                                        "default").tokens(
                                        new Tokens.Builder().token(ASCII_ELLIPSIS)))));
        placeholder.context().setTokenRegistry(tokenRegistry);
        Query query = new Query();
        query.getModel().setExecution(placeholder);
        Item parsed = RewriterFeatures.convertStringToQTree(query, "a b c "
                + ASCII_ELLIPSIS);
        assertSame(WeakAndItem.class, parsed.getClass());
        assertEquals(4, ((CompositeItem) parsed).getItemCount());
        assertEquals(ASCII_ELLIPSIS, ((CompositeItem) parsed).getItem(3).toString());
    }
Fine grained testing of RewriterFeatures for easier testing of innards.
container-search/src/test/java/com/yahoo/search/query/rewrite/RewriterFeaturesTestCase.java