@Test public void formatDifference__givenDate__shouldFormatInLargestUnit() { assertEquals("Future format for seconds wrong", "1 minute", durationFormatter.formatDifference(inTwentySeconds)); assertEquals("Future format for minutes wrong", "2 minutes", durationFormatter.formatDifference(inTwoMinutes)); assertEquals("Future format for hours wrong", "2 hours", durationFormatter.formatDifference(inTwoHours)); assertEquals("Future format for days wrong", "2 days", durationFormatter.formatDifference(inTwoDays)); assertEquals("Future format for months wrong", "2 months", durationFormatter.formatDifference(inTwoMonths)); }
public String formatDifference(Instant instant) { return formatDifference(toDate(instant)); }
DurationFormatter { public String formatDifference(Instant instant) { return formatDifference(toDate(instant)); } }
DurationFormatter { public String formatDifference(Instant instant) { return formatDifference(toDate(instant)); } private  DurationFormatter(Locale locale); }
DurationFormatter { public String formatDifference(Instant instant) { return formatDifference(toDate(instant)); } private  DurationFormatter(Locale locale); static DurationFormatter forLocale(Locale locale); static DurationFormatter forRequestLocale(); String format(Instant instant); String format(LocalDateTime localDateTime); String format(Date date); String formatAsDays(Instant instant); String formatAsDays(Date date); String formatDifference(Instant instant); String formatDifference(LocalDateTime localDateTime); String formatDifference(Date date); String formatDifferenceAsDays(Instant instant); String formatDifferenceAsDays(Date date); }
DurationFormatter { public String formatDifference(Instant instant) { return formatDifference(toDate(instant)); } private  DurationFormatter(Locale locale); static DurationFormatter forLocale(Locale locale); static DurationFormatter forRequestLocale(); String format(Instant instant); String format(LocalDateTime localDateTime); String format(Date date); String formatAsDays(Instant instant); String formatAsDays(Date date); String formatDifference(Instant instant); String formatDifference(LocalDateTime localDateTime); String formatDifference(Date date); String formatDifferenceAsDays(Instant instant); String formatDifferenceAsDays(Date date);  }