@Test
    void testEquivDuplicateRemoval() {
        {
            EquivItem root = new EquivItem();
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("b"));
            assertCanonicalized("EQUIV a b", null, root);
        }
        {
            EquivItem root = new EquivItem();
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("b"));
            assertCanonicalized("EQUIV a b", null, root);
        }
        {
            EquivItem root = new EquivItem();
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("a"));
            assertCanonicalized("a", null, root);
        }
        {
            EquivItem root = new EquivItem();
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("a"));
            assertCanonicalized("a", null, root);
        }
        {
            EquivItem root = new EquivItem();
            root.addItem(new WordItem("a"));
            root.addItem(new WordItem("b"));
            root.addItem(new WordItem("a"));
            assertCanonicalized("EQUIV a b", null, root);
        }
        {
            EquivItem root = new EquivItem();
            PhraseItem one = new PhraseItem();
            PhraseItem theOther = new PhraseItem();
            WordItem first = new WordItem("a");
            WordItem second = new WordItem("b");
            one.addItem(first);
            one.addItem(second);
            theOther.addItem(first.clone());
            theOther.addItem(second.clone());
            root.addItem(one);
            root.addItem(theOther);
            assertCanonicalized("\"a b\"", null, root);
        }
        {
            EquivItem root = new EquivItem();
            PhraseSegmentItem one = new PhraseSegmentItem("a b", "a b", true, false);
            PhraseSegmentItem theOther = new PhraseSegmentItem("a b", "a b", true, false);
            WordItem first = new WordItem("a");
            WordItem second = new WordItem("b");
            one.addItem(first);
            one.addItem(second);
            theOther.addItem(first.clone());
            theOther.addItem(second.clone());
            root.addItem(one);
            root.addItem(theOther);
            assertCanonicalized("'a b'", null, root);
        }
    }
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