@SuppressWarnings("nullness")
  public static Map<String, Object> splunkEventToMap(SplunkEvent event) {
    Map<String, Object> eventMap = new HashMap<>();
    eventMap.put(SPLUNK_EVENT_KEY, event.event());
    eventMap.put(SPLUNK_HOST_KEY, event.host());
    eventMap.put(SPLUNK_INDEX_KEY, event.index() != null ? event.index() : DEFAULT_SPLUNK_INDEX);
    eventMap.put(SPLUNK_SOURCE_KEY, event.source());
    eventMap.put(SPLUNK_SOURCE_TYPE_KEY, event.sourceType());
    eventMap.put(SPLUNK_TIME_KEY, event.time());

    return eventMap;
  }
@Test
  public void testSplunkEventToMapWithDefaultValueForIndex() {
    SplunkEvent event = SplunkEvent.newBuilder().withEvent("myEvent").create();

    Map<String, Object> expected = new HashMap<>();
    expected.put("event", "myEvent");
    expected.put("index", DEFAULT_SPLUNK_INDEX);
    expected.put("source", null);
    expected.put("sourcetype", null);
    expected.put("host", null);
    expected.put("time", null);

    assertThat(splunkEventToMap(event)).containsExactlyEntriesIn(expected);
  }