ExpiringCacheMap { public void put(K key, Supplier<@Nullable V> action) { put(key, new ExpiringCache<>(expiry, action)); } ExpiringCacheMap(Duration expiry);  ExpiringCacheMap(long expiry); void put(K key, Supplier<@Nullable V> action); void put(K key, ExpiringCache<@Nullable V> item); void putIfAbsent(K key, ExpiringCache<V> item); @Nullable V putIfAbsentAndGet(K key, Supplier<V> action); @Nullable V putIfAbsentAndGet(K key, ExpiringCache<V> item); @SuppressWarnings({ "null", "unused" }) void putValue(K key, @Nullable V value); boolean containsKey(K key); void remove(K key); void clear(); synchronized Set<K> keys(); @SuppressWarnings({ "null", "unused" }) @Nullable V get(K key); synchronized Collection<@Nullable V> values(); @SuppressWarnings({ "null", "unused" }) synchronized void invalidate(K key); synchronized void invalidateAll(); @SuppressWarnings({ "null", "unused" }) synchronized @Nullable V refresh(K key); synchronized Collection<@Nullable V> refreshAll();  }
@Test public void testPutIllegalArgumentException3() throws IllegalArgumentException { assertThrows(IllegalArgumentException.class, () -> subject.put(null, CACHE_ACTION)); }
@Test public void testPut() { subject.put(FIRST_TEST_KEY, PREDICTABLE_CACHE_ACTION_1); assertEquals(RESPONSE_1, subject.get(FIRST_TEST_KEY)); subject.put(FIRST_TEST_KEY, PREDICTABLE_CACHE_ACTION_2); String response = subject.get(FIRST_TEST_KEY); assertNotEquals(RESPONSE_1, response); assertEquals(RESPONSE_2, response); }