public final <K, V> Region<K, V> createPartitionedRegion(final String rootName,
      final RegionFactory<K, V> regionFactory) throws CacheException {
    Region<K, V> root = getRootRegion(rootName);
    if (root == null) {
      // don't put listeners on root region
      RegionFactory<K, V> regionFactory1 = getRootRegionFactory(regionFactory);
      regionFactory1.setDataPolicy(DataPolicy.PARTITION);

      root = regionFactory1.create(rootName);
    }
    return root;
  }
Local destroy all root regions and close the cache.
geode-dunit/src/main/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java