HeapCache extends AbstractSearchableCache<K, V> { @Override public V invalidate(final K key) { return caffeine.asMap().remove(key); } HeapCache(final String name, final CacheLoader<K, V> cacheLoader,
      final EvictionListener<K, V> evictionListener, final IndexHandler<K, V> indexHandler,
      final long limit, final TimeUnit expiryUnit, final long expiry); @Override void put(final K key, final V value); @Override void put(final K key, final V value, final TimeUnit timeUnit, final long duration); @Override V get(final K key); @Override V invalidate(final K key); @Override boolean contains(final K key); @Override void clear(); @Override long size(); @Override CacheStats stats();  }
@Test public void invalidate() { cache.put("a", "b"); cache.invalidate("a"); verify(indexHandler).add("a", "b"); assertEquals(cache.get("a"), null); }