private void createPartitionedRegions() {
    Cache cache = getCache();

    PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setRedundantCopies(redundantCopies);
    partitionAttributesFactory.setLocalMaxMemory(localMaxMemory);
    partitionAttributesFactory.setTotalNumBuckets(totalNumBuckets);

    RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);

    for (int i = 0; i < numberOfRegions; i++) {
      regionFactory.create(prNamePrefix + i);
    }
  }
This test aims to test the destroyRegion functionality.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java