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

    final String name = getUniqueName() + "-PR";
    vm0.invoke("Create partitioned Region", new SerializableRunnable() {
      @Override
      public void run() {
        try {

          createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes());
        } catch (CacheException ex) {
          fail("While creating Partitioned region", ex);
        }
      }
    });

    vm1.invoke("Create non-partitioned Region", new SerializableRunnable() {
      @Override
      public void run() {
        try {
          RegionFactory<String, String> factory = getCache().createRegionFactory();
          try {
            createRegion(name, "INCOMPATIBLE_ROOT", factory);
            fail("Should have thrown an IllegalStateException");
          } catch (IllegalStateException ex) {
            // pass...
          }

        } catch (CacheException ex) {
          fail("While creating Partitioned Region", ex);
        }
      }
    });
  }
Tests the compatibility of creating certain kinds of subregions of a local region.
geode-core/src/distributedTest/java/org/apache/geode/cache30/PartitionedRegionDUnitTest.java