Gets value with specific key from the cache. If the value is not present, calls defaultValue to obtain a value which is placed into the cache if not null, then returned.
This method is thread-safe.