@Test
    void test2GoodCountStats() {
        final String inputPath = INPUT_DIR + "input01_2goodCountEvents.xml";

        final ByteArrayInputStream input = new ByteArrayInputStream(getString(inputPath).getBytes());

        final StatisticStoreStore statisticStoreStore = getStore();
        final DocRef docRef = statisticStoreStore.createDocument(STAT_NAME);
        final StatisticStoreDoc statisticsDataSource = statisticStoreStore.readDocument(docRef);
        statisticsDataSource.setStatisticType(StatisticType.COUNT);
        statisticsDataSource.setConfig(new StatisticsDataSourceData(
                Arrays.asList(new StatisticField("tag1name"), new StatisticField("tag2name"))));
        statisticsDataSource.setPrecision(1000L);
        statisticsDataSource.setEnabled(true);
        statisticStoreStore.writeDocument(statisticsDataSource);

        final ErrorReceiverProxy errorReceiverProxy = new ErrorReceiverProxy(new FatalErrorReceiver());

        final StatisticsFilter statisticsFilter = new StatisticsFilter(errorReceiverProxy,
                new LocationFactoryProxy(), this, statisticStoreStore);

        statisticsFilter.setStatisticsDataSource(docRef);

        ProcessorUtil.processXml(input, errorReceiverProxy, statisticsFilter, new LocationFactoryProxy());

        assertThat(testEvents.size())
                .as("Expecting 2 events")
                .isEqualTo(2);

        assertThat(testEvents.get(0).getTimeMs())
                .isEqualTo(DateUtil.parseNormalDateTimeString("2000-01-01T00:00:00.000Z"));
        assertThat(testEvents.get(0).getName())
                .isEqualTo(STAT_NAME);
        assertThat(testEvents.get(0).getTagList().size())
                .isEqualTo(2);
        assertThat(testEvents.get(0).getTagList().get(0).getTag())
                .isEqualTo("tag1name");
        assertThat(testEvents.get(0).getTagList().get(0).getValue())
                .isEqualTo("1tag1value");
        assertThat(testEvents.get(0).getTagList().get(1).getTag())
                .isEqualTo("tag2name");
        assertThat(testEvents.get(0).getTagList().get(1).getValue())
                .isEqualTo("1tag2value");
        assertThat(testEvents.get(0).getCount())
                .isEqualTo(1L);
        assertThatThrownBy(() -> testEvents.get(0)
                .getValue()).isInstanceOf(RuntimeException.class);

        assertThat(testEvents.get(1).getTimeMs())
                .isEqualTo(DateUtil.parseNormalDateTimeString("2000-01-02T00:00:00.000Z"));
        assertThat(testEvents.get(1).getName())
                .isEqualTo(STAT_NAME);
        assertThat(testEvents.get(1).getTagList().size())
                .isEqualTo(2);
        assertThat(testEvents.get(1).getTagList().get(0).getTag())
                .isEqualTo("tag1name");
        assertThat(testEvents.get(1).getTagList().get(0).getValue())
                .isEqualTo("2tag1value");
        assertThat(testEvents.get(1).getTagList().get(1).getTag())
                .isEqualTo("tag2name");
        assertThat(testEvents.get(1).getTagList().get(1).getValue())
                .isEqualTo("2tag2value");
        assertThat(testEvents.get(1).getCount())
                .isEqualTo(1L);
        assertThatThrownBy(() -> testEvents.get(1)
                .getValue()).isInstanceOf(RuntimeException.class);
        // assertThat(testEvents.get(1).getCount()).isNull();
        // assertThat(testEvents.get(1).getValue().longValue())
        // .isEqualTo(1L);

        // <statistic time="2000-01-03T00:00:00.000Z" name="3oldstyle"
        // increment="1" precision="3600"/>
        // assertThat(// testEvents.get(2)
        // .getTimeMs())
        // .isEqualTo(DateUtil.parseNormalDateTimeString("2000-01-03T00:00:00.000Z"));
        // assertThat(testEvents.get(2).getName())
        // .isEqualTo("3oldstyle");
        // assertThat(testEvents.get(2).getPrecisionMs())
        // .isEqualTo(3600L);
        // assertThat(testEvents.get(2).getTagList().size())
        // .isEqualTo(0);
        // assertThat(testEvents.get(2).getCount().longValue())
        // .isEqualTo(2L);
        // assertThat(testEvents.get(2).getValue()).isNull();

        // <statistic time="2000-01-04T00:00:00.000Z" name="3oldstyle"
        // precision="14400000"/>
        // assertThat(// testEvents.get(3)
        // .getTimeMs())
        // .isEqualTo(DateUtil.parseNormalDateTimeString("2000-01-04T00:00:00.000Z"));
        // assertThat(testEvents.get(3).getName())
        // .isEqualTo("4oldstyle");
        // assertThat(testEvents.get(3).getPrecisionMs())
        // .isEqualTo(14400000L);
        // assertThat(testEvents.get(3).getTagList().size())
        // .isEqualTo(0);
        // assertThat(testEvents.get(3).getCount().longValue())
        // .isEqualTo(1L);
        // assertThat(testEvents.get(3).getValue()).isNull();

    }
Unit test class for <code>XMLTransformer</code>.
stroom-statistics/stroom-statistics-impl-sql/src/test/java/stroom/statistics/impl/sql/filter/TestStatisticsFilter.java