### Question:
FacadeService { public Collection<JobContext> getEligibleJobContext() { Collection<JobContext> failoverJobContexts = failoverService.getAllEligibleJobContexts(); Collection<JobContext> readyJobContexts = readyService.getAllEligibleJobContexts(failoverJobContexts); Collection<JobContext> result = new ArrayList<>(failoverJobContexts.size() + readyJobContexts.size()); result.addAll(failoverJobContexts); result.addAll(readyJobContexts); return result; } FacadeService(final CoordinatorRegistryCenter regCenter); void start(); Collection<JobContext> getEligibleJobContext(); void removeLaunchTasksFromQueue(final List<TaskContext> taskContexts); void addRunning(final TaskContext taskContext); void updateDaemonStatus(final TaskContext taskContext, final boolean isIdle); void removeRunning(final TaskContext taskContext); void recordFailoverTask(final TaskContext taskContext); void addTransient(final String jobName); Optional<CloudJobConfiguration> load(final String jobName); Optional<CloudAppConfiguration> loadAppConfig(final String appName); Optional<String> getFailoverTaskId(final TaskContext.MetaInfo metaInfo); void addDaemonJobToReadyQueue(final String jobName); boolean isRunning(final TaskContext taskContext); void addMapping(final String taskId, final String hostname); String popMapping(final String taskId); Map<String, Integer> getAllReadyTasks(); Map<String, Set<TaskContext>> getAllRunningTasks(); Map<String, Collection<FailoverTaskInfo>> getAllFailoverTasks(); boolean isJobDisabled(final String jobName); void enableJob(final String jobName); void disableJob(final String jobName); Collection<MesosStateService.ExecutorStateInfo> loadExecutorInfo(); void stop();  }### Answer:
@Test public void assertGetEligibleJobContext() { Collection<JobContext> failoverJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job"), ExecutionType.FAILOVER)); Collection<JobContext> readyJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("ready_job"), ExecutionType.READY)); Mockito.when(failoverService.getAllEligibleJobContexts()).thenReturn(failoverJobContexts); Mockito.when(readyService.getAllEligibleJobContexts(failoverJobContexts)).thenReturn(readyJobContexts); Collection<JobContext> actual = facadeService.getEligibleJobContext(); Assert.assertThat(actual.size(), Is.is(2)); int i = 0; for (JobContext each : actual) { switch (i) { case 0: Assert.assertThat(each.getJobConfig().getJobName(), Is.is("failover_job")); break; case 1: Assert.assertThat(each.getJobConfig().getJobName(), Is.is("ready_job")); break; default: break; } i++; } }