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