private Result result(Query query, Execution execution, String documentType) {
            GroupingListHit hit = hitsByDocumentType.get(documentType).get(passByDocumentType.getOrDefault(documentType, 0));
            for (Grouping grp : hit.getGroupingList()) {
                grp.setFirstLevel(passByDocumentType.getOrDefault(documentType, 0));
                grp.setLastLevel(passByDocumentType.getOrDefault(documentType, 0));
            }
            passByDocumentType.compute(documentType, (k, v) -> v == null ? 1 : v + 1);
            Result res = execution.search(query);
            res.hits().add(hit);
            return res;
        }
Simulate multiple document types returning a grouping result
container-search/src/test/java/com/yahoo/search/grouping/vespa/GroupingExecutorTestCase.java