@Test
  public void testCompactorClose() {
    DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
    diskStoreFactory.setAutoCompact(true);
    diskStoreFactory.setCompactionThreshold(100);
    diskStoreFactory.setDiskDirsAndSizes(diskDirs, diskDirSizes);

    createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 100);

    RegionFactory<Object, Object> regionFactory = cache.createRegionFactory(LOCAL);
    regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
    regionFactory.setDiskStoreName(diskStoreName);
    regionFactory.setDiskSynchronous(true);

    Region<Object, Object> region = regionFactory.create(regionName);

    CacheObserverHolder.setInstance(new CompactorCacheObserver(region));

    for (int i = 0; i < 10; ++i) {
      region.put(i, new byte[10]);
    }

    beforeGoingToCompactLatch.countDown();

    await().untilAsserted(() -> assertThat(afterStoppingCompactor).isTrue());

    assertThat(region.isDestroyed()).isTrue();
  }
Extracted {@code testCompactorClose} from {@link DiskRegionJUnitTest}.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionCompactorCloseIntegrationTest.java