### Question:
EhCacheCacheProvider implements CacheProvider,
        GuiceServletContextListener.CleanupCapable { @SuppressWarnings("unchecked") public <K, V> Cache<K, V> createCache(String name) { if (!caches.containsKey(Preconditions.checkNotNull(name))) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Creating cache named " + name); } caches.putIfAbsent(name, new EhConfiguredCache<K, V>(name, cacheManager)); } return (Cache<K, V>) caches.get(Preconditions.checkNotNull(name)); } @Inject  EhCacheCacheProvider(@Named("shindig.cache.ehcache.config") String configPath,
                              @Named("shindig.cache.ehcache.sizeof.filter") String filterPath,
                              @Named("shindig.cache.ehcache.jmx.enabled") boolean jmxEnabled,
                              @Named("shindig.cache.ehcache.jmx.stats") boolean withCacheStats,
                              GuiceServletContextListener.CleanupHandler cleanupHandler); void cleanup(); @SuppressWarnings("unchecked") Cache<K, V> createCache(String name);  }### Answer:
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); }