MobiusHooks { public static synchronized void handleError(Throwable error) { errorHandler.handleError(error); } private  MobiusHooks(); static synchronized void handleError(Throwable error); static synchronized void setErrorHandler(ErrorHandler newHandler); static synchronized void setDefaultErrorHandler();  }
@Test public void shouldHaveADefaultHandlerThatLogs() throws Exception { Exception expected = new RuntimeException("I'm expected"); MobiusHooks.handleError(expected); assertThat(appender.list) .extracting(ILoggingEvent::getFormattedMessage) .containsExactly("Uncaught error"); assertThat(appender.list) .extracting((ILoggingEvent event) -> event.getThrowableProxy().getMessage()) .containsExactly("I'm expected"); }