@Test
  public void testIncompatibleSubRegions() {
    VM vm0 = VM.getVM(0);
    VM vm1 = VM.getVM(1);


    // Scope.GLOBAL is illegal if there is any other cache in the
    // distributed system that has the same region with
    // Scope.DISTRIBUTED_NO_ACK.

    final String name = getUniqueName() + "-NO_ACK";
    vm0.invoke("Create NO ACK Region", () -> {
      try {
        RegionFactory<Object, Object> factory =
            getCache().createRegionFactory(getRegionAttributes());
        Region<Object, Object> region = createRegion(name, "INCOMPATIBLE_ROOT", factory);
        assertThat(
            getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isDistributedNoAck())
                .isTrue();
        assertThat(region.getAttributes().getScope().isDistributedNoAck()).isTrue();
      } catch (CacheException ex) {
        fail("While creating NO ACK region", ex);
      }
    });

    vm1.invoke("Create GLOBAL Region", () -> {
      try {
        RegionFactory<Object, Object> factory =
            getCache().createRegionFactory(getRegionAttributes());
        factory.setScope(Scope.GLOBAL);
        assertThat(getRootRegion("INCOMPATIBLE_ROOT")).isNull();
        try {
          createRootRegion("INCOMPATIBLE_ROOT", factory);
          fail("Should have thrown an IllegalStateException");
        } catch (IllegalStateException ex) {
          // pass...
        }

      } catch (CacheException ex) {
        fail("While creating GLOBAL Region", ex);
      }
    });

    vm1.invoke("Create ACK Region", () -> {

      try {
        RegionFactory<Object, Object> factory =
            getCache().createRegionFactory(getRegionAttributes());
        factory.setScope(Scope.DISTRIBUTED_ACK);
        assertThat(getRootRegion("INCOMPATIBLE_ROOT")).isNull();
        try {
          createRootRegion("INCOMPATIBLE_ROOT", factory);
          fail("Should have thrown an IllegalStateException");
        } catch (IllegalStateException ex) {
          // pass...
        }

      } catch (CacheException ex) {
        fail("While creating ACK Region", ex);
      }
    });
  }
Tests the compatibility of creating certain kinds of subregions of a local region.

@see RegionFactory#createSubregion
geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionDUnitTest.java