### Question:
PersistenceUtil { static boolean isTestOlderThanAverage(Instant averageInstant, TestTime test) { if(test.getLastUpdated() == null) { return true; } Instant lastUpdated = test.getLastUpdated().toInstant(); return Duration.between(averageInstant, lastUpdated).toDays() < 0; }    }### Answer:
@Test public void testOlderThanOneDay() { Instant instant = clock.instant(); Instant oneDayAgo = instant.minus(1, ChronoUnit.DAYS); testTimeLastUpdatedAt(oneDayAgo); assertTrue(PersistenceUtil.isTestOlderThanAverage(instant, testTime)); }
@Test public void testFromSameDay() { Instant instant = clock.instant(); testTimeLastUpdatedAt(instant); assertFalse(PersistenceUtil.isTestOlderThanAverage(instant, testTime)); }
@Test public void missingLastUpdated() { assertTrue(PersistenceUtil.isTestOlderThanAverage(clock.instant(), testTime)); }