### Question:
JCache implements net.sf.jsr107cache.Cache { public boolean containsValue(Object value) { long start = System.currentTimeMillis(); boolean inCache = cache.isValueInCache(value); long end = System.currentTimeMillis(); if (LOG.isWarnEnabled()) { LOG.warn("Performance Warning: containsValue is not recommended. This call took " + (end - start) + " ms"); } return inCache; } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); void setCacheLoader(JCacheLoader cacheLoader); void addListener(CacheListener cacheListener); void evict(); Map getAll(Collection keys); Map getAll(Collection keys, Object loaderArgument); CacheLoader getCacheLoader(); CacheEntry getCacheEntry(Object key); CacheStatistics getCacheStatistics(); void load(final Object key); void loadAll(final Collection keys); void loadAll(final Collection keys, final Object loaderArgument); Object peek(Object key); void removeListener(CacheListener cacheListener); int size(); boolean isEmpty(); boolean containsKey(Object key); boolean containsValue(Object value); Object get(Object key); Object get(Object key, Object loaderArgument); Object get(Object key, JCacheLoader loader); Object get(Object key, JCacheLoader loader, Object loaderArgument); Object put(Object key, Object value); Object put(Object key, Object value, int timeToLiveSeconds); Object remove(Object key); void putAll(Map sourceMap); void clear(); Set keySet(); Collection values(); Set entrySet(); void setStatisticsAccuracy(int statisticsAccuracy); Ehcache getBackingCache(); String toString();  }### Answer:
@Test public void testContainsValue() throws Exception { Ehcache ehcache = new net.sf.ehcache.Cache("testContainsValue", 2, true, false, 500, 200); manager.addCache(ehcache); Cache cache = new JCache(ehcache); assertFalse(cache.containsValue("value1")); assertFalse(cache.containsValue(null)); cache.put("key1", null); assertFalse(cache.containsValue("value1")); assertTrue(cache.containsValue(null)); cache.put("key2", "value1"); assertTrue(cache.containsValue("value1")); assertTrue(cache.containsValue(null)); assertNull(cache.get("key1")); assertNotNull(cache.get("key2")); }
@Test public void testContainsValue() throws Exception { Ehcache ehcache = new net.sf.ehcache.Cache("testContainsValue", 2, true, true, 500, 200); manager.addCache(ehcache); Cache cache = new JCache(ehcache); assertFalse(cache.containsValue("value1")); assertFalse(cache.containsValue(null)); cache.put("key1", null); assertFalse(cache.containsValue("value1")); assertTrue(cache.containsValue(null)); cache.put("key2", "value1"); assertTrue(cache.containsValue("value1")); assertTrue(cache.containsValue(null)); assertNull(cache.get("key1")); assertNotNull(cache.get("key2")); }