SlideshowFXHandler extends StreamHandler { public void addPropertyChangeListener(PropertyChangeListener listener) { this.propertyChangeSupport.addPropertyChangeListener(listener); } SlideshowFXHandler(); void addPropertyChangeListener(PropertyChangeListener listener); void removePropertyChangeListener(PropertyChangeListener listener); String getLatestLog(); synchronized String getAllLogs(); @Override synchronized void publish(LogRecord record);  }
@Test @DisplayName("fires an event when the latest log changes") void eventFired() throws InterruptedException, ExecutionException, TimeoutException { final CompletableFuture<Boolean> eventFired = new CompletableFuture<>(); handler.addPropertyChangeListener(event -> eventFired.complete(true)); LOGGER.info("A message for event"); assertTrue(eventFired.get(5, SECONDS)); }