private PartitionedRegion createPartitionedRegion(Cache cache, String regionName,
      int localMaxMemory, int redundancy, int totalNumBuckets) {
    PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setLocalMaxMemory(localMaxMemory);
    partitionAttributesFactory.setRedundantCopies(redundancy);
    partitionAttributesFactory.setTotalNumBuckets(totalNumBuckets);

    RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);
    regionFactory.setPartitionAttributes(partitionAttributesFactory.create());
    return (PartitionedRegion) regionFactory.create(regionName);
  }
This verifies the Bucket Regions on the basis of redundantCopies set in RegionAttributes.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionHADUnitTest.java