### Question:
AbstractCacheManager implements CacheManager { @Override public <K, V> Cache<K, V> getCache( String cacheName ) { return (Cache<K, V>) getCache( cacheName, Object.class, Object.class ); } AbstractCacheManager(); @Override CachingProvider getCachingProvider(); @Override Cache<K, V> createCache( String cacheName, C configuration ); @Override URI getURI(); @Override ClassLoader getClassLoader(); @Override Properties getProperties(); @Override Cache<K, V> getCache( String cacheName ); @Override Cache<K, V> getCache( String cacheName, Class<K> keyType, Class<V> valueType ); @Override Iterable<String> getCacheNames(); @Override void destroyCache( String cacheName ); @Override void enableManagement( String cacheName, boolean enabled ); @Override void enableStatistics( String cacheName, boolean enabled ); @Override void close(); @Override boolean isClosed(); @Override T unwrap( Class<T> clazz );  }### Answer:
@Test public void testGetCache() throws Exception { assertThat( cacheManager.getCacheNames(), emptyIterable() ); assertThat( cacheManager.getCache( CACHE_NAME, String.class, Map.class ), nullValue() ); MutableConfiguration<String, Map> configuration = new MutableConfiguration<String, Map>(); configuration.setTypes( String.class, Map.class ); Cache<String, Map> typedCache = cacheManager.createCache( CACHE_NAME, configuration ); Cache anonymousCache = cacheManager.createCache( ANONYMOUS_TYPE_CACHE, new MutableConfiguration<Object, Object>() ); assertThat( cacheManager.getCache( CACHE_NAME, String.class, Map.class ), sameInstance( typedCache ) ); assertThat( cacheManager.getCache( ANONYMOUS_TYPE_CACHE ), sameInstance( anonymousCache ) ); assertThat( cacheManager.getCacheNames(), containsInAnyOrder( ANONYMOUS_TYPE_CACHE, CACHE_NAME ) ); thrown.expect( IllegalArgumentException.class ); cacheManager.getCache( CACHE_NAME, Integer.class, List.class ); }