Interval implements TemporalAmount { @Override public List<TemporalUnit> getUnits() { return units; } Interval(final Period period, final Duration duration);  Interval(final Duration duration);  Interval(final Period period); Period getPeriod(); Duration getDuration(); long toEpochMilli(final long fromEpochMilli); @Override long get(final TemporalUnit unit); @Override List<TemporalUnit> getUnits(); @Override Temporal addTo(final Temporal temporal); @Override Temporal subtractFrom(final Temporal temporal); @Override int hashCode(); @Override boolean equals(final Object o); @Override String toString(); static Interval parse(final String text);  }
@Test public void shouldReturnAllPeriodAndDurationUnits() { final Interval interval = new Interval(Period.of(1, 2, 3), Duration.ofSeconds(5, 35)); assertThat(interval.getUnits()) .containsExactlyInAnyOrder( ChronoUnit.SECONDS, ChronoUnit.NANOS, ChronoUnit.MONTHS, ChronoUnit.DAYS, ChronoUnit.YEARS); }