private void validateCreateDistributedRegionThrows(final String regionName,
      final Class<? extends Exception> exceptionClass) {
    RegionFactory regionFactory = getCache().createRegionFactory(RegionShortcut.REPLICATE);
    assertThatThrownBy(() -> regionFactory.create(regionName)).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