public static Duration buildDuration(final long size, final String timeUnitName) {
    final TimeUnit timeUnit = parseTimeUnit(timeUnitName.toUpperCase());
    return Duration.ofNanos(timeUnit.toNanos(size));
  }
@Test
  public void shouldBuildDuration() {
    assertThat(DurationParser.buildDuration(20, "DAYS"), is(Duration.ofDays(20)));
  }