### Question:
TaskunImpl implements Taskun { long getDelayValue(Calendar executeDate, TimeUnit timeUnit) { Calendar current = CalendarUtil.getCurrentTime(); long delayMillis = executeDate.getTimeInMillis() - current.getTimeInMillis(); if (timeUnit.equals(TimeUnit.DAYS)) { return delayMillis / 1000 / 60 / 60 / 24; } else if (timeUnit.equals(TimeUnit.HOURS)) { return delayMillis / 1000 / 60 / 60; } else if (timeUnit.equals(TimeUnit.MICROSECONDS)) { return delayMillis * 1000; } else if (timeUnit.equals(TimeUnit.MILLISECONDS)) { return delayMillis; } else if (timeUnit.equals(TimeUnit.MINUTES)) { return delayMillis / 1000 / 60; } else if (timeUnit.equals(TimeUnit.NANOSECONDS)) { return delayMillis * 1000 * 1000; } else if (timeUnit.equals(TimeUnit.SECONDS)) { return delayMillis / 1000; } else { throw new UnsupportedOperationException("unexpected TimeUnit value"); } }  void initialize(TaskunConfig config); void initialize(TaskunInjector taskunInjector); @Override void start(); @Override void scheduleCronExecute(Runnable runnable, RawCrontabLine crontabLine); @Override void scheduleIntervalExecute(Runnable runnable, Calendar initialScheduledDate, long interval, TimeUnit timeUnit); @Override void scheduleOnetime(Runnable runnable, Calendar scheduledDate); @Override void shutdown(); @Override void replaceCrontabFile(String crontabFilepath); @Override boolean isRunning(); @Override List<RawCrontabLine> getCurrentRawCrontabLines(); @Override long getLastCronInvocationTimeMillis();  }### Answer:
@Test public void getDelayValue_A$Calendar$TimeUnit_day() throws Exception { TaskunImpl target = new TaskunImpl(); Calendar arg0 = CalendarUtil.getCurrentTime(); arg0 = CalendarUtil.addDays(arg0, 1); long actual = target.getDelayValue(arg0, TimeUnit.DAYS); long expected = 1L; assertEquals(expected, actual); }
@Test public void getDelayValue_A$Calendar$TimeUnit_minute() throws Exception { TaskunImpl target = new TaskunImpl(); Calendar arg0 = CalendarUtil.getCurrentTime(); arg0 = CalendarUtil.addMinutes(arg0, 1); long actual = target.getDelayValue(arg0, TimeUnit.MINUTES); long expected = 1L; assertEquals(expected, actual); }
@Test public void getDelayValue_A$Calendar$TimeUnit_second() throws Exception { TaskunImpl target = new TaskunImpl(); Calendar arg0 = CalendarUtil.getCurrentTime(); arg0 = CalendarUtil.addSeconds(arg0, 1); long actual = target.getDelayValue(arg0, TimeUnit.SECONDS); long expected = 1L; assertEquals(expected, actual); }
@Test public void getDelayValue_A$Calendar$TimeUnit_hour() throws Exception { TaskunImpl target = new TaskunImpl(); Calendar arg0 = CalendarUtil.getCurrentTime(); arg0 = CalendarUtil.addHours(arg0, 1); long actual = target.getDelayValue(arg0, TimeUnit.HOURS); long expected = 1L; assertEquals(expected, actual); }