public bool Put(TKey entryKey, TVal entryVal) { bool success = false; if (keyValues.ContainsKey(entryKey)) { keyValues.Remove(entryKey); } if (entries.Count >= this.cacheSize) { CacheEntry <TKey, TVal> cacheEntryToEvict = Policy.EvictionPolicy(this.entries); keyValues.Remove(cacheEntryToEvict.Key); } CacheEntry <TKey, TVal> cacheEntry = new CacheEntry <TKey, TVal>(entryKey, entryVal); entries.Enqueue(cacheEntry); keyValues.Add(entryKey, entryVal); success = true; return(success); }