private void validateNodeFailMetaDataCleanUp(final DistributedMember expectedMember) {
    Region rootReg = PartitionedRegionHelper.getPRRoot(getCache());
    CacheListener[] cls = rootReg.getAttributes().getCacheListeners();
    assertThat(cls).hasSize(2);

    CertifiableTestCacheListener ctcl = (CertifiableTestCacheListener) cls[1];

    for (Object regionNameObject : rootReg.keySet()) {
      String regionName = (String) regionNameObject;
      ctcl.waitForUpdated(regionName);

      Object prConfigObject = rootReg.get(regionName);
      if (prConfigObject != null) {
        PartitionRegionConfig prConfig = (PartitionRegionConfig) prConfigObject;
        Set<Node> nodes = prConfig.getNodes();
        for (Node node : nodes) {
          DistributedMember member = node.getMemberId();
          assertThat(member).isNotEqualTo(expectedMember);
        }
      }
    }
  }
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