class TimedCache {

    public boolean update(K key)
    {
        Long curr = new Long(System.currentTimeMillis());
        Long prev = cache.putIfAbsent(key, curr);
        
        if (prev == null) {
        		return false;
        }

        if (curr - prev > this.timeoutInterval) {
            if (cache.replace(key, prev, curr)) {
            		return false;
            }
        }
        
        return true;
    }

    public  TimedCache(int capacity, int timeToLive);

}