public boolean isStarted() {
        return jobLeaderIdActions != null;
    }
@Test
    void testIsStarted() throws Exception {
        final JobID jobId = new JobID();
        TestingHighAvailabilityServices highAvailabilityServices =
                new TestingHighAvailabilityServices();
        SettableLeaderRetrievalService leaderRetrievalService =
                new SettableLeaderRetrievalService(null, null);
        highAvailabilityServices.setJobMasterLeaderRetriever(jobId, leaderRetrievalService);
        ScheduledExecutor scheduledExecutor = mock(ScheduledExecutor.class);
        Time timeout = Time.milliseconds(5000L);
        JobLeaderIdActions jobLeaderIdActions = mock(JobLeaderIdActions.class);
        DefaultJobLeaderIdService jobLeaderIdService =
                new DefaultJobLeaderIdService(highAvailabilityServices, scheduledExecutor, timeout);

        assertThat(jobLeaderIdService.isStarted()).isFalse();

        jobLeaderIdService.start(jobLeaderIdActions);

        assertThat(jobLeaderIdService.isStarted()).isTrue();

        jobLeaderIdService.stop();

        assertThat(jobLeaderIdService.isStarted()).isFalse();
    }