@Test
public void testGetValue()
{

    double millis = 12346789.0d;
    Duration duration = new Duration(millis, MILLISECONDS);
    assertThat(duration.getValue(MILLISECONDS)).isEqualTo(millis);
    assertThat(duration.getValue(SECONDS)).isCloseTo(millis / 1000, offset(0.001));
    assertThat(duration.getValue(MINUTES)).isCloseTo(millis / 1000 / 60, offset(0.001));
    assertThat(duration.getValue(HOURS)).isCloseTo(millis / 1000 / 60 / 60, offset(0.001));
    assertThat(duration.getValue(DAYS)).isCloseTo(millis / 1000 / 60 / 60 / 24, offset(0.001));
    double days = 3.0;
    duration = new Duration(days, DAYS);
    assertThat(duration.getValue(DAYS)).isEqualTo(days);
    assertThat(duration.getValue(HOURS)).isCloseTo(days * 24, offset(0.001));
    assertThat(duration.getValue(MINUTES)).isCloseTo(days * 24 * 60, offset(0.001));
    assertThat(duration.getValue(SECONDS)).isCloseTo(days * 24 * 60 * 60, offset(0.001));
    assertThat(duration.getValue(MILLISECONDS)).isCloseTo(days * 24 * 60 * 60 * 1000, offset(0.001));
}