public LRUCache(int capacity) {
        cache  =  new TreeMap<>(new Comparator<Key>(){
            @Override
            public int compare (Key k1, Key k2) {
                if ( k1.time < k2.time ) {
                    return -1;
                } else if ( k1.time == k2.time ) {
                    return 0;
                } else {
                    return 1;
                }
            }
        });
        timeStamp  =  0;
        this.capacity  =  capacity;
    }