ExpiringCacheMap { @SuppressWarnings({ "null", "unused" }) public void putValue(K key, @Nullable V value) { final ExpiringCache<@Nullable V> item = items.get(key); if (item == null) { throw new IllegalArgumentException(String.format("No item found for key '%s' .", key)); } else { item.putValue(value); } } 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 testPutValueIllegalArgumentException1() throws IllegalArgumentException { assertThrows(IllegalArgumentException.class, () -> subject.putValue("KEY_NOT_FOUND", "test")); }
@Test public void testPutValue() { subject.put(FIRST_TEST_KEY, CACHE_ACTION); subject.putValue(FIRST_TEST_KEY, "test"); String value = subject.get(FIRST_TEST_KEY); assertEquals("test", value); }