private void createPartitionedRegion(final String regionName, final int localMaxMemory,
      final int redundancy) {
    PartitionAttributesFactory paf = new PartitionAttributesFactory();
    paf.setLocalMaxMemory(localMaxMemory);
    paf.setRedundantCopies(redundancy);

    RegionFactory regionFactory = getCache().createRegionFactory(RegionShortcut.PARTITION);
    regionFactory.setPartitionAttributes(paf.create());

    Region region = regionFactory.create(regionName);
    assertThat(region).isNotNull();
  }
Verifies creation of partitioned region and distributed region with same name.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionWithSameNameDUnitTest.java