private static void destroyRegions(final Cache cache) {
    if (cache != null && !cache.isClosed()) {
      // try to destroy the root regions first so that we clean up any persistent files.
      for (Region<?, ?> root : cache.rootRegions()) {
        String regionFullPath = root == null ? null : root.getFullPath();
        // for colocated regions you can't locally destroy a partitioned region.
        if (root.isDestroyed() || root instanceof HARegion || root instanceof PartitionedRegion) {
          continue;
        }
        try {
          root.localDestroyRegion("CacheRule_tearDown");
        } catch (Exception ignore) {
        }
      }
    }
  }
Use {@code Builder} for more options in constructing {@code CacheRule}.

@return a new {@code Builder}
geode-dunit/src/main/java/org/apache/geode/test/dunit/rules/CacheRule.java