private <K, V> RegionFactory<K, V> getRootRegionFactory(RegionFactory<K, V> regionFactory) {
    MyRegionFactory<K, V> regionFactory1 = new MyRegionFactory<>(regionFactory);
    ExpirationAttributes expiration = ExpirationAttributes.DEFAULT;

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