### Question:
Job { public static long toDuration(Period period) { return period.toStandardSeconds().getSeconds(); } Job(Scheduled scheduled, Method method, Every every); static long toDuration(Period period); static long getDurationFromPeriod(Every every); Method method(); Runnable function(); void submitted(ManagedScheduledFutureTask task); ManagedScheduledFutureTask task(); Scheduled scheduled(); long period(); TimeUnit unit(); static final PeriodFormatter PERIOD_FORMATTER; }### Answer:
@Test public void testToDuration() throws Exception { long duration = Job.toDuration(Period.hours(1)); assertThat(duration).isEqualTo(3600); duration = Job.toDuration(Period.days(1)); assertThat(duration).isEqualTo(24 * 3600); duration = Job.toDuration(Period.hours(2).plusMinutes(30).plusSeconds(5)); assertThat(duration).isEqualTo(9005); }