@Test
void putEvents_multipleEvents() {

    final HBaseStatisticsConfig hBaseStatisticsConfig = new HBaseStatisticsConfig();
    hBaseStatisticsConfig.setDocRefType(DOC_REF_TYPE_1);
    hBaseStatisticsConfig.getKafkaTopicsConfig().setCount("MyTopic");
    initMocks();
    StroomStatsInternalStatisticsService stroomStatsInternalStatisticsService =
            new StroomStatsInternalStatisticsService(
                    mockStroomKafkaProducerFactory,
                    hBaseStatisticsConfig);
    //assemble test data
    InternalStatisticEvent event1 = InternalStatisticEvent.createPlusOneCountStat(
            InternalStatisticKey.MEMORY, 0, Collections.emptyMap());
    InternalStatisticEvent event2 = InternalStatisticEvent.createPlusOneCountStat(
            InternalStatisticKey.MEMORY, 1, Collections.emptyMap());
    InternalStatisticEvent event3 = InternalStatisticEvent.createPlusOneCountStat(
            InternalStatisticKey.MEMORY, 1, Collections.emptyMap());
    DocRef docRefA = new DocRef(DOC_REF_TYPE_1, UUID.randomUUID().toString(), "myStat1");
    DocRef docRefB = new DocRef(DOC_REF_TYPE_2, UUID.randomUUID().toString(), "myStat2");
    Map<DocRef, List<InternalStatisticEvent>> map = Map.of(
            docRefA, Arrays.asList(event1, event2),
            docRefB, Collections.singletonList(event3));
    stroomStatsInternalStatisticsService.putEvents(map);
    //two different doc refs so two calls to producer
    Mockito.verify(mockKafkaProducer, Mockito.times(2))
            .send(Mockito.any(ProducerRecord.class));
}