private void validateCreateDistributedSubRegionThrows(final String parentRegionName,
      final String childRegionName, final Class<? extends Exception> exceptionClass) {
    Region parentRegion = getCache().getRegion(parentRegionName);
    assertThat(parentRegion).isNotNull();

    RegionFactory regionFactory = getCache().createRegionFactory(RegionShortcut.REPLICATE);

    assertThatThrownBy(() -> regionFactory.createSubregion(parentRegion, childRegionName))
        .isInstanceOf(exceptionClass);
  }
Verifies creation of partitioned region and distributed region with same name.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionWithSameNameDUnitTest.java