@Test
  public void testSetGlobalProperties() throws Exception {
    vm0.invoke(() -> {
      Cache cache = cacheRule.getOrCreateCache();

      RegionFactory<String, String> regionFactory = cache.createRegionFactory(PARTITION);
      PartitionAttributesFactory<String, String> paf = new PartitionAttributesFactory<>();
      paf.setTotalNumBuckets(totalNumBuckets);
      regionFactory.setPartitionAttributes(paf.create());
      regionFactory.create("PR1");
    });

    vm1.invoke(() -> {
      Cache cache = cacheRule.getOrCreateCache();

      RegionFactory<String, String> regionFactory = cache.createRegionFactory(PARTITION);
      PartitionAttributesFactory<String, String> paf = new PartitionAttributesFactory<>();
      regionFactory.setPartitionAttributes(paf.create());

      try (IgnoredException ie = addIgnoredException(IllegalStateException.class)) {
        assertThatThrownBy(() -> regionFactory.create("PR1"))
            .isInstanceOf(IllegalStateException.class);
      }

      Properties globalProperties = new Properties();
      globalProperties.setProperty(GLOBAL_MAX_BUCKETS_PROPERTY, "" + totalNumBuckets);
      paf.setGlobalProperties(globalProperties);
      regionFactory.setPartitionAttributes(paf.create());
      PartitionedRegion accessor = (PartitionedRegion) regionFactory.create("PR1");

      assertThat(accessor.getTotalNumberOfBuckets()).isEqualTo(totalNumBuckets);
    });
  }
Tests {@link PartitionAttributesFactory#setGlobalProperties(Properties)} which is deprecated.
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCreationTotalNumBucketsDistributedTest.java