put

fun put(key: K, value: V): V?

Stores value under key and marks the entry most recently used.

Returns the value previously stored under key, or null if the key was absent. Inserting a new key while the cache is at maxSize evicts the least recently used entry; the evicted value is discarded, not returned. Replacing an existing key never evicts.