private RegionAttributes createAtts(List callbacks) {
    AttributesFactory factory = new AttributesFactory();

    {
      TestCacheListener listener = new TestCacheListener() {};
      callbacks.add(listener);
      factory.setCacheListener(listener);
    }
    {
      TestCacheWriter writer = new TestCacheWriter() {};
      callbacks.add(writer);
      factory.setCacheWriter(writer);
    }
    {
      TestCacheLoader loader = new TestCacheLoader() {
        @Override
        public Object load2(LoaderHelper helper) throws CacheLoaderException {
          fail("load2 should not be called by this test");
          return null;
        }

        @Override
        public void close2() {
          throw new RuntimeException(
              "make sure exceptions from close callbacks are logged and ignored");
        }
      };
      callbacks.add(loader);
      factory.setCacheLoader(loader);
    }

    return factory.create();
  }
Test to make sure cache close is working.

@since GemFire 3.0
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheCloseDUnitTest.java