title: How to put() values into Guava's Cache class?
body: <p>I'm a little confused by <a href="https://google.github.io/guava/releases/22.0/api/docs/com/google/common/cache/CacheBuilder.html" rel="nofollow noreferrer">CacheBuilder</a> and <a href="https://google.github.io/guava/releases/22.0/api/docs/com/google/common/cache/Cache.html" rel="nofollow noreferrer">Cache</a> introduced in Guava 10. The documentation hints that it's possible to <a href="https://google.github.io/guava/releases/22.0/api/docs/com/google/common/cache/CacheBuilder.html#expireAfterWrite-long-java.util.concurrent.TimeUnit-" rel="nofollow noreferrer">overwrite values</a> but as far as I can tell, <a href="https://google.github.io/guava/releases/22.0/api/docs/com/google/common/cache/Cache.html" rel="nofollow noreferrer">Cache</a> does not contain any methods for doing so. Any ideas?</p>
  
  <p>I'm trying to construct a Map that expires a key 10 seconds after it was last read or written-to. When a value is looked up, I expect the previously-set value to be returned, or a default value to be computed if none exists.</p>
  
  <p><strong>NOTE</strong>: This question is outdated. Although the above Javadoc shows the existence of a <code>Cache.put(K key, V value)</code> method, it not exist when the question was first posted.</p>