@SuppressWarnings("unchecked")
    public static synchronized <T extends Cache> T createCache(String name) {
        T cache = (T) caches.get(name);
        if (cache != null) {
            return cache;
        }
        cache = (T) cacheFactoryStrategy.createCache(name);

        log.info("Created cache [" + cacheFactoryStrategy.getClass().getName() + "] for " + name);

        return wrapCache(cache, name);
    }
@Test
    public void testCacheRecreation() throws Exception
    {
        // Setup test fixture.
        final String name = "unittest-cache-recreation";

        // Execute system under test.
        final Cache resultA = CacheFactory.createCache(name);
        final Cache resultB = CacheFactory.createCache(name);

        // Verify results.
        assertNotNull(resultB);
        assertSame(resultA, resultB);
    }