@Override
    public void onError(Throwable t) {
        forwardErrorToLeaderContender(t);
    }
@Test
    void testErrorForwarding() throws Exception {
        new Context() {
            {
                runTestWithSynchronousEventHandling(
                        () -> {
                            final Exception testException = new Exception("test leader exception");

                            leaderElectionService.onError(testException);

                            applyToBothContenderContexts(
                                    contenderContext -> {
                                        assertThat(contenderContext.contender.getError())
                                                .isNotNull()
                                                .hasCause(testException);

                                        contenderContext.contender.clearError();
                                    });
                        });
            }
        };
    }