@Override
    public CompletableFuture<ApplicationStatus> getShutDownFuture() {
        return shutDownFuture;
    }
@Test
    public void getShutDownFuture_newLeader_ignoresOldDispatcherLeaderProcessShutDownRequest()
            throws Exception {
        final UUID firstLeaderSessionId = UUID.randomUUID();
        final UUID secondLeaderSessionId = UUID.randomUUID();
        final CompletableFuture<ApplicationStatus> shutDownFuture = new CompletableFuture<>();
        final TestingDispatcherLeaderProcess firstTestingDispatcherLeaderProcess =
                TestingDispatcherLeaderProcess.newBuilder(firstLeaderSessionId)
                        .setShutDownFuture(shutDownFuture)
                        .build();
        final TestingDispatcherLeaderProcess secondTestingDispatcherLeaderProcess =
                TestingDispatcherLeaderProcess.newBuilder(secondLeaderSessionId).build();
        testingDispatcherLeaderProcessFactory =
                TestingDispatcherLeaderProcessFactory.from(
                        firstTestingDispatcherLeaderProcess, secondTestingDispatcherLeaderProcess);

        try (final DispatcherRunner dispatcherRunner = createDispatcherRunner()) {
            leaderElection.isLeader(firstLeaderSessionId);

            final CompletableFuture<ApplicationStatus> dispatcherShutDownFuture =
                    dispatcherRunner.getShutDownFuture();

            assertFalse(dispatcherShutDownFuture.isDone());

            leaderElection.isLeader(secondLeaderSessionId);

            final ApplicationStatus finalApplicationStatus = ApplicationStatus.UNKNOWN;
            shutDownFuture.complete(finalApplicationStatus);

            assertFalse(dispatcherShutDownFuture.isDone());
        }
    }