public void set(int key, int value) {
        timeStamp++;
        if ( cache.containsKey(new Key(key, 0)) ) {
            cache.put(new Key(key, timeStamp), value);
        } else {
            if ( cache.size() >= capacity ) {
                cache.pollFirstEntry();
            }
            cache.put(new Key(key, timeStamp), value);
        }
    }