### Question:
TimeDuration { public static Duration ofHours(double hour) { return Duration.ofNanos((long) (hour * 60 * 60 * NANOSEC_IN_SEC)); } private  TimeDuration(); static Duration createDuration(long sec, int nanoSec); static Duration ofHours(double hour); static Duration ofMinutes(double min); static Duration ofSeconds(double sec); static Duration ofHertz(double hz); static int dividedBy(Duration dividendDuration, Duration divisorDuration); static double toSecondsDouble(Duration duration); static String toSecondString(Duration duration);  }### Answer:
@Test public void hour1() { Duration duration = TimeDuration.ofHours(1.0); assertThat(duration.getNano(), equalTo(0)); assertThat(duration.getSeconds(), equalTo(3600L)); }
@Test public void hour2() { Duration duration = TimeDuration.ofHours(0.123456789); assertThat(duration.getNano(), equalTo(444440399)); assertThat(duration.getSeconds(), equalTo(444L)); }
@Test public void hour3() { Duration duration = TimeDuration.ofHours(-1.23456789); assertThat(duration.getNano(), equalTo(555596001)); assertThat(duration.getSeconds(), equalTo(-4445L)); }