class CachedObject {

    public synchronized T get(Supplier<T> refreshFunction) {
        long currentTime = currentTimeSupplier.getAsLong();
        long millisecondsSinceLastRefresh = currentTime - lastRefreshTime;
        long secondsSinceLastRefresh = TimeUnit.MILLISECONDS.toSeconds(millisecondsSinceLastRefresh);
        if (object == null || secondsSinceLastRefresh > expirationTimeInSeconds) {
            this.object = refreshFunction.get();
            this.lastRefreshTime = currentTimeSupplier.getAsLong();
        }
        return object;
    }

    public  CachedObject(long expirationTimeInSeconds);
    public  CachedObject(long expirationTimeInSeconds, LongSupplier currentTimeSupplier);

}