@Test
  public void testDestroyRegion() throws Exception {
    vm0.invoke(this::createPartitionedRegions);
    vm1.invoke(this::createPartitionedRegions);
    vm2.invoke(this::createPartitionedRegions);
    vm3.invoke(this::createPartitionedRegions);

    vm1.invoke(() -> {
      try (IgnoredException ie = addIgnoredException(RegionDestroyedException.class)) {
        Cache cache = getCache();
        for (int i = 0; i < numberOfRegions; i++) {
          Region<Integer, String> region = cache.getRegion(prNamePrefix + i);
          // Create enough entries such that all bucket are created, integer keys assumes mod
          // distribution
          int totalEntries = ((PartitionedRegion) region).getTotalNumberOfBuckets() * 2;
          for (int k = 0; k < totalEntries; k++) {
            region.put(k, prNamePrefix + k);
          }
        }
      }
    });

    AsyncInvocation<Void> asyncVM2 = vm2.invokeAsync(() -> {
      try (IgnoredException ie = addIgnoredException(RegionDestroyedException.class)) {
        Cache cache = getCache();

        // Grab the regions right away, before they get destroyed by the other thread
        PartitionedRegion[] regions = new PartitionedRegion[numberOfRegions];
        for (int i = 0; i < numberOfRegions; i++) {
          regions[i] = (PartitionedRegion) cache.getRegion(SEPARATOR + prNamePrefix + i);
          assertThat(regions[i]).isNotNull();
        }

        signalLatch.countDown();

        for (int i = 0; i < numberOfRegions; i++) {
          PartitionedRegion region = regions[i];
          int startEntries = region.getTotalNumberOfBuckets() * 20;
          int endEntries = startEntries + region.getTotalNumberOfBuckets();
          boolean isDestroyed = false;
          for (int k = startEntries; k < endEntries; k++) {
            final int key = k;
            try {
              if (isDestroyed) {
                assertThatThrownBy(() -> region.put(key, prNamePrefix + key))
                    .isInstanceOf(RegionDestroyedException.class);
              } else {
                region.put(key, prNamePrefix + key);
              }
            } catch (RegionDestroyedException e) {
              isDestroyed = true;
            }
          }
          Thread.sleep(loopSleepMillis);
        }
      }
    });

    addIgnoredException(ReplyException.class);

    vm2.invoke(() -> signalLatch.await(30, SECONDS));

    vm0.invoke(() -> {
      Cache cache = getCache();
      for (int i = 0; i < numberOfRegions; i++) {
        Region region = cache.getRegion(prNamePrefix + i);
        assertThat(region).isNotNull();

        region.destroyRegion();
        assertThat(region.isDestroyed()).isTrue();

        assertThat(cache.getRegion(prNamePrefix + i)).isNull();
      }
    });

    asyncVM2.await();

    vm0.invoke(this::validateMetaDataAfterDestroy);
    vm1.invoke(this::validateMetaDataAfterDestroy);
    vm2.invoke(this::validateMetaDataAfterDestroy);
    vm3.invoke(this::validateMetaDataAfterDestroy);
  }
This test aims to test the destroyRegion functionality.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java