### Question:
LogMessageTracker { public long countEvents() { return logAppender.list.size(); } LogMessageTracker(Class<?> loggedClass);  LogMessageTracker(String loggerName); void startTracking(); void stopTracking(); boolean contains(Pattern regex); boolean contains(String content); boolean contains(Pattern regex, Level level); boolean contains(String content, Level level); List<ILoggingEvent> search(Pattern regex); List<ILoggingEvent> search(String content); List<ILoggingEvent> search(Pattern regex, Level level); List<ILoggingEvent> search(String content, Level level); long countEvents(); List<ILoggingEvent> getAllLoggedEvents(); List<ILoggingEvent> getAllLoggedEventsWithLevel(Level level);  }### Answer:
@Test void givenLogTracker_whenCleanUp_thenLogsReleasedFromTracking() { assertEquals(5, logMessageTracker.countEvents()); }