@Test
    void slightlyMoreComplexTree() {
        Query q = new Query();
        AndItem a0 = new AndItem();
        OrItem o0 = new OrItem();
        PhraseItem p0 = new PhraseItem();
        p0.setIndexName(BAMSE);
        PhraseSegmentItem p1 = new PhraseSegmentItem("Overbuljongterningpakkmesterassistent", true, false);
        p1.setIndexName(BAMSE);

        WordItem tmp;
        tmp = new WordItem("Nalle0", BAMSE, true);
        a0.addItem(tmp);

        tmp = new WordItem("Nalle1", BAMSE, true);
        o0.addItem(tmp);
        tmp = new WordItem("Nalle2", BAMSE, true);
        o0.addItem(tmp);
        a0.addItem(o0);

        tmp = new WordItem("Nalle3", BAMSE, true);
        p0.addItem(tmp);

        p1.addItem(new WordItem("Over", BAMSE, true));
        p1.addItem(new WordItem("buljong", BAMSE, true));
        p1.addItem(new WordItem("terning", BAMSE, true));
        p1.addItem(new WordItem("pakk", BAMSE, true));
        p1.addItem(new WordItem("Mester", BAMSE, true));
        p1.addItem(new WordItem("assistent", BAMSE, true));
        p1.lock();
        p0.addItem(p1);
        a0.addItem(p0);

        q.getModel().getQueryTree().setRoot(a0);

        Result r = createExecution().search(q);
        AndItem root = (AndItem) r.getQuery().getModel().getQueryTree().getRoot();
        tmp = (WordItem) root.getItem(0);
        assertEquals("nalle0", tmp.getWord());
        OrItem orElement = (OrItem) root.getItem(1);
        tmp = (WordItem) orElement.getItem(0);
        assertEquals("nalle1", tmp.getWord());
        tmp = (WordItem) orElement.getItem(1);
        assertEquals("nalle2", tmp.getWord());
        PhraseItem phrase = (PhraseItem) root.getItem(2);
        tmp = (WordItem) phrase.getItem(0);
        assertEquals("nalle3", tmp.getWord());
        PhraseSegmentItem locked = (PhraseSegmentItem) phrase.getItem(1);
        assertEquals("over", ((WordItem) locked.getItem(0)).getWord());
        assertEquals("buljong", ((WordItem) locked.getItem(1)).getWord());
        assertEquals("terning", ((WordItem) locked.getItem(2)).getWord());
        assertEquals("pakk", ((WordItem) locked.getItem(3)).getWord());
        assertEquals("mester", ((WordItem) locked.getItem(4)).getWord());
        assertEquals("assistent", ((WordItem) locked.getItem(5)).getWord());
    }
Tests term lowercasing in the search chain.

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