private void validateBucketRedundancy(Map<VM, Boolean> stillHasDS, VM vm) {
    // only validate buckets on remaining VMs
    if (stillHasDS.get(vm)) {
      vm.invoke(() -> {
        PartitionedRegion pr = (PartitionedRegion) getCache().getRegion(uniqueName + "0");
        for (int bucketId : pr.getRegionAdvisor().getBucketSet()) {
          assertThatBucketHasRedundantCopies(pr, bucketId);
        }
      });
    }

  }
Test for peer recovery of buckets when a member is removed from the distributed system
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java