### Question:
TimeWindowReporter implements Reporter, AutoCloseable { protected void start() { synchronized (this) { if (!isRunning()) { reportingThread = new Thread(this::run, getThreadName(threadId.get())); reportingThread.setDaemon(true); reportingThread.start(); } else { throw new IllegalStateException("Already started"); } } } TimeWindowReporter(final String name);  TimeWindowReporter(final String name, final int windowStepSizeSeconds);  TimeWindowReporter(final String name, final int windowStepSizeSeconds,
      final Map<Class<? extends Metric>, Function<Metric, ? extends Aggregator>> defaultAggregators);  TimeWindowReporter(final String name, final int windowStepSizeSeconds,
      final Map<Class<? extends Metric>, Function<Metric, ? extends Aggregator>> defaultAggregators,
      final Map<String, Function<Metric, ? extends Aggregator>> metricAggregators); @Override void emit(final Metric metric, final long timestamp, final long value,
      final String[] tags); @Override void close(); static final int DEFAULT_WINDOW_STEP_SIZE_SEC; }### Answer:
@Test public void logsErrorWhileReportingMetrics(@Capturing Logger logger) throws InterruptedException { RuntimeException exptected = new RuntimeException(); reporter = new TimeWindowReporter("testReport", 1) { @Override protected void doReport(Map<String, Aggregator> multiCursor) { throw exptected; } }; reporter.start(); Thread.sleep(1001); new Verifications() {{ logger.error("Error reporting metrics", exptected); }}; }