@Override
    public void startLeaderElection(LeaderContender contender) throws Exception {
        Preconditions.checkNotNull(contender);
        parentService.register(componentId, contender);
    }
@Test
    void testContenderRegistrationFailure() throws Exception {
        final Exception expectedException =
                new Exception("Expected exception during contender registration.");
        final DefaultLeaderElection.ParentService parentService =
                TestingAbstractLeaderElectionService.newBuilder()
                        .setRegisterConsumer(
                                (actualComponentId, actualContender) -> {
                                    throw expectedException;
                                })
                        .build();
        try (final DefaultLeaderElection testInstance =
                new DefaultLeaderElection(parentService, DEFAULT_TEST_COMPONENT_ID)) {
            assertThatThrownBy(
                            () ->
                                    testInstance.startLeaderElection(
                                            TestingGenericLeaderContender.newBuilder().build()))
                    .isEqualTo(expectedException);
        }
    }