@Test
  public void testNumberOfPartitions() {
    addIgnoredException(IllegalStateException.class);

    member1.invoke(() -> {
      cache.set(new CacheFactory(getDistributedSystemProperties()).create());
      createPartitionedRegion(REGION_NAME, null, 1, 0, 9, newQuarterPartitionResolver());
    });

    member2.invoke(() -> {
      cache.set(new CacheFactory(getDistributedSystemProperties()).create());
      FixedPartitionAttributes fpa1 = createFixedPartition("Q11", true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition("Q12", false, 3);
      createPartitionedRegion(REGION_NAME, asList(fpa1, fpa2), 1, 40, 9,
          newQuarterPartitionResolver());
    });

    member3.invoke(() -> {
      cache.set(new CacheFactory(getDistributedSystemProperties()).create());
      FixedPartitionAttributes fpa1 = createFixedPartition("Q12", true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition("Q13", false, 3);
      FixedPartitionAttributes fpa3 = createFixedPartition("Q11", false, 3);
      createPartitionedRegion(REGION_NAME, asList(fpa1, fpa2, fpa3), 1, 40, 9,
          newQuarterPartitionResolver());
    });

    member4.invoke(() -> {
      cache.set(new CacheFactory(getDistributedSystemProperties()).create());
      FixedPartitionAttributes fpa1 = createFixedPartition("Q13", true, 3);
      FixedPartitionAttributes fpa2 = createFixedPartition("Q11", false, 3);

      Throwable thrown = catchThrowable(() -> {
        createPartitionedRegion(REGION_NAME, asList(fpa1, fpa2), 1, 40, 9,
            newQuarterPartitionResolver());
      });

      assertThat(thrown)
          .isInstanceOf(IllegalStateException.class)
          .hasMessageContaining("should never exceed number of redundant copies");
    });
  }
Number of primary partitions (which should be one for a partition) and secondary partitions of
a FPR for a partition should never exceed number of redundant copies + 1. IllegalStateException
is thrown during FPR creation if this condition is not met.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java