### Question:
StatisticManager { public JobTypeStatistics getJobTypeStatistics() { int scriptJobCnt = 0; int simpleJobCnt = 0; int dataflowJobCnt = 0; for (CloudJobConfiguration each : configurationService.loadAll()) { if (JobType.SCRIPT.equals(each.getTypeConfig().getJobType())) { scriptJobCnt++; } else if (JobType.SIMPLE.equals(each.getTypeConfig().getJobType())) { simpleJobCnt++; } else if (JobType.DATAFLOW.equals(each.getTypeConfig().getJobType())) { dataflowJobCnt++; } } return new JobTypeStatistics(scriptJobCnt, simpleJobCnt, dataflowJobCnt); } private  StatisticManager(final CoordinatorRegistryCenter registryCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration,
                             final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData); static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration); void startup(); void shutdown(); void taskRunSuccessfully(); void taskRunFailed(); TaskResultStatistics getTaskResultStatisticsWeekly(); TaskResultStatistics getTaskResultStatisticsSinceOnline(); TaskResultStatistics findLatestTaskResultStatistics(final StatisticInterval statisticInterval); List<TaskResultStatistics> findTaskResultStatisticsDaily(); JobTypeStatistics getJobTypeStatistics(); JobExecutionTypeStatistics getJobExecutionTypeStatistics(); List<TaskRunningStatistics> findTaskRunningStatisticsWeekly(); List<JobRunningStatistics> findJobRunningStatisticsWeekly(); List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline();  }### Answer:
@Test public void assertJobTypeStatistics() throws NoSuchFieldException { ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); Mockito.when(configurationService.loadAll()).thenReturn(Lists.newArrayList( CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_simple"), CloudJobConfigurationBuilder.createDataflowCloudJobConfiguration("test_job_dataflow"), CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("test_job_script"))); Assert.assertThat(statisticManager.getJobTypeStatistics().getSimpleJobCount(), Is.is(1)); Assert.assertThat(statisticManager.getJobTypeStatistics().getDataflowJobCount(), Is.is(1)); Assert.assertThat(statisticManager.getJobTypeStatistics().getScriptJobCount(), Is.is(1)); Mockito.verify(configurationService, Mockito.times(3)).loadAll(); }