@Test public void expiresSoon() { assertFalse(newTimeLimitedBase(true, 80, EPOCH, EPOCH.plusSeconds(60)).expiresSoon(ofSeconds(10)), "lease duration > grace period"); assertTrue(newTimeLimitedBase(true, 9, EPOCH, EPOCH.plusSeconds(60)).expiresSoon(ofSeconds(10)), "lease duration < grace period"); }
public boolean expiresSoon(Duration gracePeriod) { return leaseDurationSecs < gracePeriod.getSeconds(); }
TimeLimitedBase { public boolean expiresSoon(Duration gracePeriod) { return leaseDurationSecs < gracePeriod.getSeconds(); } }
TimeLimitedBase { public boolean expiresSoon(Duration gracePeriod) { return leaseDurationSecs < gracePeriod.getSeconds(); } TimeLimitedBase(boolean renewable, long leaseDurationSecs);  TimeLimitedBase(TimeLimitedBase other); }
TimeLimitedBase { public boolean expiresSoon(Duration gracePeriod) { return leaseDurationSecs < gracePeriod.getSeconds(); } TimeLimitedBase(boolean renewable, long leaseDurationSecs);  TimeLimitedBase(TimeLimitedBase other); boolean isExpired(); boolean shouldExtend(Duration gracePeriod); Instant getExpireInstant(); Date getExpiredDate(); boolean expiresSoon(Duration gracePeriod); String info(); void leaseDurationSanityCheck(String nickname, Duration gracePeriod); }
TimeLimitedBase { public boolean expiresSoon(Duration gracePeriod) { return leaseDurationSecs < gracePeriod.getSeconds(); } TimeLimitedBase(boolean renewable, long leaseDurationSecs);  TimeLimitedBase(TimeLimitedBase other); boolean isExpired(); boolean shouldExtend(Duration gracePeriod); Instant getExpireInstant(); Date getExpiredDate(); boolean expiresSoon(Duration gracePeriod); String info(); void leaseDurationSanityCheck(String nickname, Duration gracePeriod); public boolean renewable; public long leaseDurationSecs; }