@Test
  public void testDestroyExtensions() throws Exception {

    // create caching member
    dataMember = clusterStartupRule.startServerVM(1, locator.getPort());

    // Connect Gfsh to locator.
    gfsh.connectAndVerify(locator);

    createRegion(REPLICATE_REGION, RegionShortcut.REPLICATE, null);
    createMockRegionExtension(REPLICATE_REGION, "value1");
    destroyMockRegionExtension(REPLICATE_REGION);
    createMockCacheExtension("value1");
    destroyMockCacheExtension();

    // Start a new member which receives the shared configuration
    // Verify the config creation on this member
    MemberVM newMember = clusterStartupRule.startServerVM(2, locator.getPort());
    newMember.invoke(() -> {
      InternalCache cache = ClusterStartupRule.getCache();
      assertNotNull(cache);

      Region<?, ?> region1 = cache.getRegion(REPLICATE_REGION);
      assertNotNull(region1);

      // MockRegionExtension verification
      @SuppressWarnings("unchecked")
      final Extensible<Region<?, ?>> extensibleRegion = (Extensible<Region<?, ?>>) region1;
      // Should not be any region extensions
      assertTrue(!extensibleRegion.getExtensionPoint().getExtensions().iterator().hasNext());

      // MockCacheExtension verification
      final Extensible<Cache> extensibleCache = cache;
      // Should not be any cache extensions
      assertTrue(!extensibleCache.getExtensionPoint().getExtensions().iterator().hasNext());
    });
  }
Tests for {@link Extension}, {@link Extensible}, {@link XmlParser}, {@link XmlGenerator},
{@link XmlEntity} as it applies to Extensions. Asserts that Mock Extension is created and
destroyed on region and cache.

@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/ExtensionClusterConfigurationDUnitTest.java