@VisibleForTesting
  static Duration toDuration(long val, TimeUnit unit) {
    return Duration.of(val, toChronoUnit(unit));
  }
@Test
  public void toDuration() {
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.NANOSECONDS))
        .isEqualTo(Duration.ofNanos(5L));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.MICROSECONDS))
        .isEqualTo(Duration.of(5L, ChronoUnit.MICROS));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.MILLISECONDS))
        .isEqualTo(Duration.ofMillis(5L));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.SECONDS))
        .isEqualTo(Duration.ofSeconds(5L));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.MINUTES))
        .isEqualTo(Duration.ofMinutes(5L));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.HOURS)).isEqualTo(Duration.ofHours(5L));
    assertThat(TimerResultParser.toDuration(5L, TimeUnit.DAYS)).isEqualTo(Duration.ofDays(5L));
  }