public static ErrorHandler setupErrorHandler(final ErrorHandler userErrorHandler, final DistinctErrorLog errorLog)
    {
        return setupErrorHandler(userErrorHandler, errorLog, fallbackLogger());
    }
@Test
    void setupErrorHandlerReturnsAnErrorHandlerThatFirstInvokesLoggingErrorHandlerBeforeCallingSuppliedErrorHandler()
    {
        final Throwable throwable = new Throwable("Hello, world!");
        final ErrorHandler userErrorHandler = mock(ErrorHandler.class);
        final AssertionError userHandlerError = new AssertionError("user handler error");
        doThrow(userHandlerError).when(userErrorHandler).onError(throwable);
        final DistinctErrorLog distinctErrorLog = mock(DistinctErrorLog.class);
        doReturn(true).when(distinctErrorLog).record(any(Throwable.class));
        final InOrder inOrder = inOrder(userErrorHandler, distinctErrorLog);

        final ErrorHandler errorHandler = CommonContext.setupErrorHandler(userErrorHandler, distinctErrorLog);

        assertNotNull(errorHandler);
        assertNotSame(userErrorHandler, errorHandler);

        final AssertionError error = assertThrowsExactly(AssertionError.class, () -> errorHandler.onError(throwable));
        assertSame(userHandlerError, error);

        inOrder.verify(distinctErrorLog).record(throwable);
        inOrder.verify(userErrorHandler).onError(throwable);
        inOrder.verifyNoMoreInteractions();
    }