@Override
    public void onLeaderInformationChange(String componentId, LeaderInformation leaderInformation) {
        synchronized (lock) {
            notifyLeaderInformationChangeInternal(
                    componentId,
                    leaderInformation,
                    confirmedLeaderInformation.forComponentIdOrEmpty(componentId));
        }
    }
@Test
    void testAllLeaderInformationChangeEventWithUnknownComponentId() throws Exception {
        final AtomicReference<LeaderInformationRegister> storedLeaderInformation =
                new AtomicReference<>();
        new Context(storedLeaderInformation) {
            {
                runTestWithSynchronousEventHandling(
                        () -> {
                            final UUID leaderSessionID = UUID.randomUUID();
                            grantLeadership(leaderSessionID);

                            final LeaderInformationRegister correctLeaderInformationRegister =
                                    storedLeaderInformation.get();
                            assertThat(correctLeaderInformationRegister.getRegisteredComponentIds())
                                    .containsExactlyInAnyOrder(
                                            contenderContext0.componentId,
                                            contenderContext1.componentId);

                            // change LeaderInformation only affects an unregistered componentId
                            final String unknownComponentId = createRandomComponentId();
                            final LeaderInformationRegister
                                    partiallyChangedLeaderInformationRegister =
                                            LeaderInformationRegister.merge(
                                                    correctLeaderInformationRegister,
                                                    unknownComponentId,
                                                    LeaderInformation.known(
                                                            UUID.randomUUID(),
                                                            "address-for-" + unknownComponentId));
                            storedLeaderInformation.set(partiallyChangedLeaderInformationRegister);
                            leaderElectionService.onLeaderInformationChange(
                                    partiallyChangedLeaderInformationRegister);

                            assertThat(storedLeaderInformation.get())
                                    .as(
                                            "The HA backend shouldn't have been touched by the service.")
                                    .isSameAs(partiallyChangedLeaderInformationRegister);
                        });
            }
        };
    }