MRJobCountImpl { public String moveTimeForwardOneDay(String startTime) throws ParseException { long timeInSecs = DateTimeUtil.humanDateToSeconds(startTime); timeInSecs -= 24L * 60L * 60L; return DateTimeUtil.secondsToHumanDate(timeInSecs); }  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 test() throws ParseException { String timeString = "2016-08-22 20:13:00"; long timestamp = DateTimeUtil.humanDateToSeconds(timeString); String timeString2 = DateTimeUtil.secondsToHumanDate(timestamp); Assert.assertTrue(timeString2.equals(timeString)); String timeString3 = helper.moveTimeForwardOneDay(timeString); Assert.assertTrue(timeString3.equals("2016-08-21 20:13:00")); String timeString4 = helper.moveTimeForwardOneDay(timeString3); Assert.assertTrue(timeString4.equals("2016-08-20 20:13:00")); }