### Question:
EventParser { protected List<Map<String, Object>> parse(List<Event> events) { List<Map<String, Object>> parsedEvents = new ArrayList<Map<String, Object>>(); if (!CollectionUtils.isEmpty(events)) { for (Event event : events) { parsedEvents.add(parseEvent(event)); } } return parsedEvents; } EventParser(String timestampField);   }### Answer:
@Test public void parseValidEvents() throws Exception { List<Event> events = buildEvents(); final List<Map<String, Object>> parsedEvents = eventParser.parse(events); assertThat(parsedEvents).isNotNull(); assertThat(parsedEvents.size()).isEqualTo(2); }
@Test public void parseEmptyEvents() throws Exception { List<Event> events = new ArrayList<Event>(); final List<Map<String, Object>> parsedEvents = eventParser.parse(events); assertThat(parsedEvents).isNotNull(); assertThat(parsedEvents.size()).isEqualTo(0); }
@Test public void parseInvalidEvents() { Assertions.assertThat(eventParser.parse(null)).isEmpty(); }