Get the element for the specified key if it has already been set or otherwise associate the key with the given (lazy) value.
Get the element for the specified key if it has already been set or otherwise associate the key with the given (lazy) value.
the value previously associated with the key or (if no value had been previously set) the specified new value.
Thread-safe cache implementation.
Given the expected use cases (a map with often just one or at most a handful of elements in it and being accessed infrequently), this implementation is not aggressively optimized and focusses on thread-safety.