Blocked { public boolean isValid(final RemoteData remoteData) { return persistent || storedOn.isAfter(remoteData.getStatistics() .getTimestamp()); } Blocked(final int id, final Money amount, final Rating rating);  Blocked(final int id, final Money amount, final Rating rating, final boolean persistent); int getId(); Money getAmount(); Rating getRating(); boolean isValid(final RemoteData remoteData); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test void nonPersistentExpiring() { final Zonky zonky = harmlessZonky(); final Tenant tenant = mockTenant(zonky); OffsetDateTime loadOn = zonky.getStatistics() .getTimestamp() .minusSeconds(1); DateUtil.setSystemClock(Clock.fixed(loadOn.toInstant(), Defaults.ZONE_ID)); final Blocked b = new Blocked(0, Money.ZERO, Rating.D, false); RemoteData r = RemoteData.load(tenant); assertThat(b.isValid(r)).isFalse(); }