### Question:
LoggingMetricExporter implements MetricExporter { @Override public CompletableResultCode flush() { CompletableResultCode resultCode = new CompletableResultCode(); for (Handler handler : logger.getHandlers()) { try { handler.flush(); } catch (Throwable t) { return resultCode.fail(); } } return resultCode.succeed(); }  @Override CompletableResultCode export(Collection<MetricData> metrics); @Override CompletableResultCode flush(); @Override void shutdown();  }### Answer:
@Test void testFlush() { final AtomicBoolean flushed = new AtomicBoolean(false); Logger.getLogger(LoggingMetricExporter.class.getName()) .addHandler( new StreamHandler(System.err, new SimpleFormatter()) { @Override public synchronized void flush() { flushed.set(true); } }); exporter.flush(); assertThat(flushed.get()).isTrue(); }