private void validateNodeFailBucket2NodeCleanUp(final InternalDistributedMember member) {
    getCache();
    Map prIdToPR = PartitionedRegion.getPrIdToPR();
    for (Object prRegionObject : prIdToPR.values()) {
      if (prRegionObject == PartitionedRegion.PRIdMap.DESTROYED) {
        continue;
      }
      PartitionedRegion prRegion = (PartitionedRegion) prRegionObject;

      for (int bucketId : prRegion.getRegionAdvisor().getBucketSet()) {
        Set<InternalDistributedMember> bucketOwners =
            prRegion.getRegionAdvisor().getBucketOwners(bucketId);
        assertThat(bucketOwners).doesNotContain(member);
      }
    }
  }
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