DefaultCacheManager implements CacheManager { @Override public Cache putCache(String name, int maxElementsInMemory) { return putCache(new DefaultCache(name, maxElementsInMemory)); } DefaultCacheManager(); @Override Collection<Cache> getCaches(); @Override Cache getCache(String name); @Override Cache putCache(String name, int maxElementsInMemory); @Override Collection<String> getCacheNames(); @Override void clearAllEntries(); @Override boolean cacheExists(String name);  }
@Test(expected = MappingException.class) public void testAddDuplicateCachesSingleton() { String cacheName = getRandomString(); cacheMgr.putCache(cacheName, 1); cacheMgr.putCache(cacheName, 1); }