@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);
    }
Asserts that a previously created cache is returned on subsequent invocations of the creation method.
xmppserver/src/test/java/org/jivesoftware/util/cache/CacheFactoryTest.java