private boolean awaitRedundancyRecovery(Map<VM, Boolean> stillHasDS, VM vm) {
    // only wait on the remaining VMs
    if (stillHasDS.get(vm)) {
      vm.invoke(() -> {
        Region region = getCache().getRegion(uniqueName + "0");
        assertTrue(region instanceof PartitionedRegion);
        PartitionedRegion partitionedRegion = (PartitionedRegion) region;
        PartitionedRegionStats prs = partitionedRegion.getPrStats();

        // Wait for recovery
        await()
            .untilAsserted(() -> assertThat(prs.getLowRedundancyBucketCount()).isEqualTo(0));
      });
      return true;
    } else {
      return false;
    }
  }
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