### Question:
EventConverter { public Map<String, Object> toMap(Boolean renameProperties) { Map<String, Object> outMap = new HashMap<>(); event.getFields().forEach((key, value) -> outMap.put(getValue(value, renameProperties), makeEntry (value, renameProperties))); return outMap; } EventConverter(Event event); Map<String, Object> toMap(Boolean renameProperties); Map<String, Object> toMap(); Map<String, Object> toInputEventMap();  }### Answer:
@Test public void testSimpleEventConversion() { Map<String, Object> runtimeMap = RuntimeTestUtils.simpleMap(); Event event = RuntimeTestUtils.makeSimpleEvent(runtimeMap, RuntimeTestUtils.getSourceInfo()); Map<String, Object> convertedMap = new EventConverter(event).toMap(); assertEquals(1, convertedMap.keySet().size()); assertEquals(1, convertedMap.get("timestamp")); }
@Test public void testNestedEventConversion() { Map<String, Object> runtimeMap = RuntimeTestUtils.nestedMap(); Event event = RuntimeTestUtils.makeSimpleEvent(runtimeMap, RuntimeTestUtils.getSourceInfo()); Map<String, Object> convertedMap = new EventConverter(event).toMap(); assertEquals(2, convertedMap.keySet().size()); assertEquals(1, convertedMap.get("timestamp")); assertTrue(convertedMap.containsKey("nested")); assertTrue(Map.class.isInstance(convertedMap.get("nested"))); Map<String, Object> nestedMap = (Map<String, Object>) convertedMap.get("nested"); assertTrue(nestedMap.containsKey("timestamp2")); assertEquals(2, nestedMap.get("timestamp2")); }