private void createPersistentPRThrows(final String regionName, final int localMaxMemory,
      final boolean isPersistent, final String message) {
    Cache cache = getCache();

    RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);

    if (isPersistent) {
      regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
    } else {
      regionFactory.setDataPolicy(DataPolicy.PARTITION);
    }

    PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setLocalMaxMemory(localMaxMemory);
    regionFactory.setPartitionAttributes(partitionAttributesFactory.create());

    assertThatThrownBy(() -> regionFactory.create(regionName))
        .isInstanceOf(IllegalStateException.class).hasMessageContaining(message);
  }
This tests persistence conflicts btw members of partition region
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java