@Override
    public T get() {
        long nanos = this.expirationNanos;
        long now = System.nanoTime();

        if (nanos == 0 || now - nanos >= 0) {
            synchronized (this) {
                if (nanos == this.expirationNanos) { // recheck for lost race
                    // compute the value using the delegate
                    T t = this.supplier.get();
                    this.value = t;

                    // reset expiration timer
                    nanos = now + this.durationNanos;
                    // In the very unlikely event that nanos is 0, set it to 1;
                    // no one will notice 1 ns of tardiness.
                    this.expirationNanos = (nanos == 0) ? 1 : nanos;
                    return t;
                }
            }
        }
        return this.value;
    }
An expiring supplier extension.

<p>The delegate supplier is only called on executions of {@link #get()} if the
result isn't already calculated.</p>

@param <T> the supplied type
helper/src/main/java/me/lucko/helper/cache/Expiring.java