set method

void set(
  1. K key,
  2. V value
)

Implementation

void set(K key, V value) {
  _cache.remove(key);
  _cache[key] = value;
  if (_cache.length > capacity) {
    _cache.remove(_cache.keys.first);
  }
}