@Test public void testToString () { Instant expiryTime = Instant.now(); Object to = new Object(); Expiring<Object> t = new Expiring<>(to, expiryTime); assertTrue(t.toString().contains(String.format("%s", to))); }
@Override public String toString () { return String.format("%s (%s left)", this.object, Duration.between(now(), expiryTime)); }
Expiring { @Override public String toString () { return String.format("%s (%s left)", this.object, Duration.between(now(), expiryTime)); } }
Expiring { @Override public String toString () { return String.format("%s (%s left)", this.object, Duration.between(now(), expiryTime)); } Expiring(T object, Instant expiryTime);  Expiring(T object, long millis);  Expiring(T object, Duration objectDuration); }
Expiring { @Override public String toString () { return String.format("%s (%s left)", this.object, Duration.between(now(), expiryTime)); } 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 { @Override public String toString () { return String.format("%s (%s left)", this.object, Duration.between(now(), expiryTime)); } 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);  }