### Question:
Period implements Comparable<Period> { public Duration getDuration() { long days = beginDate.until(endDate, ChronoUnit.DAYS); return ChronoUnit.DAYS.getDuration().multipliedBy(days); } Period(final LocalDate beginDate, final LocalDate endDateExclusive);  Period(final LocalDate beginDate, final LocalDate endDateExclusive, final boolean lastPeriod);  Period(final LocalDate beginDate, final int periodLength);  Period(final int periodLength, final LocalDate endDate); LocalDate getBeginDate(); LocalDate getEndDate(); boolean isLastPeriod(); Duration getDuration(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(@Nonnull Period o); @Override String toString();  }### Answer:
@Test public void getDuration() throws Exception { final Period testSubjectByDates = new Period(today, dayAfterTommorrow); Assert.assertEquals(2, testSubjectByDates.getDuration().toDays()); final Period testSubjectByDuration = new Period(today, 5); Assert.assertEquals(5, testSubjectByDuration.getDuration().toDays()); }