@Test public void testConstructor () { final Expiring<Object> t = new Expiring<>(object, Instant.now()); await().atLeast(100, TimeUnit.MILLISECONDS).until(t::isExpired); assertNull(t.computeIfAbsent(() -> { throw new Exception(); }, -1000L)); final Expiring<Object> t2 = new Expiring<>(object, -1000L); await().atLeast(100, TimeUnit.MILLISECONDS).until(t2::isExpired); assertNull(t2.computeIfAbsent(() -> { throw new Exception(); }, -1000L)); }
public T computeIfAbsent (Callable<T> callable, long durationInMillis) { return computeIfAbsent(callable, Duration.ofMillis(durationInMillis)); }
Expiring { public T computeIfAbsent (Callable<T> callable, long durationInMillis) { return computeIfAbsent(callable, Duration.ofMillis(durationInMillis)); } }
Expiring { public T computeIfAbsent (Callable<T> callable, long durationInMillis) { return computeIfAbsent(callable, Duration.ofMillis(durationInMillis)); } Expiring(T object, Instant expiryTime);  Expiring(T object, long millis);  Expiring(T object, Duration objectDuration); }
Expiring { public T computeIfAbsent (Callable<T> callable, long durationInMillis) { return computeIfAbsent(callable, Duration.ofMillis(durationInMillis)); } Expiring(T object, Instant expiryTime);  Expiring(T object, long millis);  Expiring(T object, Duration objectDuration); T value(); @Override String toString(); void expire(); T computeIfAbsent(Callable<T> callable, long durationInMillis); T computeIfAbsent(Callable<T> callable, Duration objectDuration); }
Expiring { public T computeIfAbsent (Callable<T> callable, long durationInMillis) { return computeIfAbsent(callable, Duration.ofMillis(durationInMillis)); } Expiring(T object, Instant expiryTime);  Expiring(T object, long millis);  Expiring(T object, Duration objectDuration); T value(); @Override String toString(); void expire(); T computeIfAbsent(Callable<T> callable, long durationInMillis); T computeIfAbsent(Callable<T> callable, Duration objectDuration);  }