MRJobCountImpl { public void initJobCountList(List<UnitJobCount> jobCounts, long startTime, long endTime, long intervalInSecs) { for (long i = startTime / intervalInSecs; i * intervalInSecs <= endTime; i++) { jobCounts.add(new UnitJobCount(i * intervalInSecs * DateTimeUtil.ONESECOND)); } }  void initJobCountList(List<UnitJobCount> jobCounts, long startTime, long endTime, long intervalInSecs); String moveTimeForwardOneDay(String startTime); JobCountResponse getRunningJobCount(List<JobExecutionAPIEntity> historyJobs,
                                               List<org.apache.eagle.jpm.mr.runningentity.JobExecutionAPIEntity> runningJobs,
                                               long startTimeInSecs,
                                               long endTimeInSecs,
                                               long intervalInSecs); JobCountResponse getHistoryJobCountGroupByDuration(List<JobExecutionAPIEntity> jobDurations, String timeList); void countJob(UnitJobCount counter, String jobType); void countJob(List<UnitJobCount> jobCounts, long jobStartTimeSecs, long jobEndTimeSecs, long intervalInSecs, String jobType); List<String> getSearchTimeDuration(List<JobExecutionAPIEntity> jobEntities);  }
@Test public void test2() throws ParseException { String startTime = "2016-08-22 20:13:00"; String endTime = "2016-08-22 24:13:00"; List<MRJobTaskCountResponse.UnitJobCount> jobCounts = new ArrayList<>(); helper.initJobCountList(jobCounts, DateTimeUtil.humanDateToSeconds(startTime), DateTimeUtil.humanDateToSeconds(endTime), 15 * 60); Assert.assertTrue(DateTimeUtil.millisecondsToHumanDateWithSeconds(jobCounts.get(1).timeBucket).equals("2016-08-22 20:15:00")); }