private <K, V> AttributesFactory<K, V> getRootAttributesFactory(
      RegionAttributes<K, V> regionAttributes) {
    AttributesFactory<K, V> attributesFactory = new AttributesFactory<>(regionAttributes);
    ExpirationAttributes expiration = ExpirationAttributes.DEFAULT;

    attributesFactory.setCacheLoader(null);
    attributesFactory.setCacheWriter(null);
    attributesFactory.setPoolName(null);
    attributesFactory.setRegionTimeToLive(expiration);
    attributesFactory.setEntryTimeToLive(expiration);
    attributesFactory.setRegionIdleTimeout(expiration);
    attributesFactory.setEntryIdleTimeout(expiration);
    return attributesFactory;
  }
Local destroy all root regions and close the cache.
geode-dunit/src/main/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java