@Test
  public void testIncompatibleSubregions() throws CacheException {
    // Scope.DISTRIBUTED_NO_ACK is illegal if there is any other cache
    // in the distributed system that has the same region with
    // Scope.GLOBAL

    final String name = getUniqueName() + "-GLOBAL";
    vm0.invoke("Create GLOBAL Region", () -> {
      createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes());
      assertThat(getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isGlobal())
          .isTrue();
    });

    vm1.invoke("Create NO ACK Region", () -> {
      RegionFactory<Object, Object> factory =
          getCache().createRegionFactory(getRegionAttributes());
      factory.setScope(Scope.DISTRIBUTED_NO_ACK);
      try {
        assertThat(getRootRegion("INCOMPATIBLE_ROOT")).isNull();
        createRegion(name, "INCOMPATIBLE_ROOT", factory);

        fail("Should have thrown an IllegalStateException");
      } catch (IllegalStateException ignored) {
        // pass...
      }
    });

    vm1.invoke("Create ACK Region", () -> {
      RegionFactory<Object, Object> factory =
          getCache().createRegionFactory(getRegionAttributes());
      factory.setScope(Scope.DISTRIBUTED_ACK);
      try {
        Region<Object, Object> rootRegion = factory.create("INCOMPATIBLE_ROOT");
        fail("Should have thrown an IllegalStateException");
      } catch (IllegalStateException ex) {
        // pass...
        assertThat(getRootRegion()).isNull();
      }
    });
  }
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/GlobalRegionDUnitTest.java