@Test
    @Disabled
    void testGroupedCounts() {
        //we want all data here
        final ExpressionOperator.Builder expressionBuilder = ExpressionOperator.builder();
        expressionBuilder.addTerm("UserId", ExpressionTerm.Condition.EQUALS, "*");

        final List<String> componentIds = Collections.singletonList("table-1");

        // we have 20 different user IDs so should get 20 rows
        int expectedResultCount = 20;
        boolean extractValues = true;

        Consumer<Map<String, List<Row>>> resultMapConsumer = resultMap -> {
            assertThat(resultMap.size()).isEqualTo(1);
            List<Row> rows = resultMap.values().iterator().next();
            assertThat(rows.size()).isEqualTo(expectedResultCount);

            long totalCount = rows.stream()
                    .map(row -> row.getValues().get(1)) // get the 'count' field
                    .mapToLong(Long::parseLong)
                    .sum();

            assertThat(totalCount).isEqualTo(STREAM_ROW_COUNT * STREAM_COUNT);
        };

        AbstractSearchTest.testInteractive(
                expressionBuilder,
                expectedResultCount,
                componentIds,
                this::createTableSettings,
                extractValues,
                resultMapConsumer,
                indexStore,
                searchResponseCreatorManager);

        LOGGER.info("Completed search");
    }
Run a query that gets counts grouped by userid and assert the total count
stroom-app/src/test/java/stroom/search/manualtesting/TestGroupedCountsInteractiveSearch.java