@Test
    void testBlendingMultipleDocumentTypesWithGrouping() {
        DocumentSourceSearcher docSource = new DocumentSourceSearcher();

        Query q = new Query("/search?query=test");

        Result r = new Result(q);

        RootGroup root1 = new RootGroup(0, null);
        Group subGroup11 = new Group(new StringBucketId("a", "b"), new Relevance(1.0));
        subGroup11.add(new Group(new StringId("unique1"), new Relevance(1.0)));
        subGroup11.add(new Group(new StringId("unique5"), new Relevance(1.0)));
        subGroup11.add(new Group(new StringId("unique6"), new Relevance(1.0)));
        subGroup11.add(new Group(new StringId("unique7"), new Relevance(1.0)));
        root1.add(subGroup11);
        r.hits().add(root1);

        RootGroup root2 = new RootGroup(0, null);
        Group subGroup21 = new Group(new StringBucketId("a", "b"), new Relevance(1.0));
        subGroup21.add(new Group(new StringId("unique1"), new Relevance(1.0)));
        subGroup21.add(new Group(new StringId("unique2"), new Relevance(1.0)));
        subGroup21.add(new Group(new StringId("unique3"), new Relevance(1.0)));
        root2.add(subGroup21);
        Group subGroup22 = new Group(new StringBucketId("c", "d"), new Relevance(1.0));
        subGroup22.add(new Group(new StringId("unique3"), new Relevance(1.0)));
        subGroup22.add(new Group(new StringId("unique4"), new Relevance(1.0)));
        root2.add(subGroup22);
        r.hits().add(root2);

        docSource.addResult(q, r);

        Chain<Searcher> chain = new Chain<>("main",
                new FillSearcher(),
                new BlendingSearcher(ComponentId.fromString("test"), new QrSearchersConfig.Builder().build()),
                docSource);
        q.setWindow(0, 10);
        Result result = new Execution(chain, Execution.Context.createContextStub()).search(q);
        assertEquals(3, result.hits().size());

        assertTrue(result.hits().get(0) instanceof Group);
        Group resultSubGroup1 = (Group) result.hits().get(0);
        assertEquals(4, resultSubGroup1.asList().size());

        assertTrue(result.hits().get(1) instanceof Group);
        Group resultSubGroup2 = (Group) result.hits().get(1);
        assertEquals(3, resultSubGroup2.asList().size());

        assertTrue(result.hits().get(2) instanceof Group);
        Group resultSubGroup3 = (Group) result.hits().get(2);
        assertEquals(2, resultSubGroup3.asList().size());
    }
Multiple document types in the same cluster are returned without a top level group representing each
container-search/src/test/java/com/yahoo/prelude/searcher/test/BlendingSearcherTestCase.java