@Test
    void testMultilevelRankCollapsing() {
        CompositeItem root = new RankItem();
        CompositeItem l1 = new RankItem();
        CompositeItem l2 = new RankItem();
        CompositeItem l3 = new RankItem();
        CompositeItem l4 = new RankItem();

        root.addItem(l1);

        l1.addItem(l2);
        l1.addItem(new WordItem("l1"));

        l2.addItem(l3);
        l2.addItem(new WordItem("l2"));

        l3.addItem(l4);
        l3.addItem(new WordItem("l3"));

        l4.addItem(new WordItem("l4"));

        assertCanonicalized("RANK l4 l3 l2 l1", null, root);
    }
Multiple levels of RANK should collapse
container-search/src/test/java/com/yahoo/prelude/query/test/QueryCanonicalizerTestCase.java