BucketAdvisor extends CacheDistributionAdvisor { public boolean isShadowBucketDestroyed(String shadowBucketPath) { return destroyedShadowBuckets.getOrDefault(shadowBucketPath, false); } private  BucketAdvisor(Bucket bucket, RegionAdvisor regionAdvisor); static BucketAdvisor createBucketAdvisor(Bucket bucket, RegionAdvisor regionAdvisor); Lock getPrimaryMoveReadLock(); boolean deposePrimary(); InternalDistributedMember getPreferredNode(); @Override boolean shouldSyncForCrashedMember(InternalDistributedMember id); @Override DistributedRegion getRegionForDeltaGII(); void checkForLostPrimaryElector(Profile profile); @Override synchronized boolean putProfile(Profile profile, boolean forceProfile); synchronized void updateServerBucketProfile(BucketProfile p); BucketProfile getLocalProfile(); @Override boolean removeId(ProfileId memberId, boolean crashed, boolean destroyed,
      boolean fromMembershipListener); @Override boolean removeIdWithSerial(InternalDistributedMember memberId, int serialNum,
      boolean regionDestroyed); @Override Set<InternalDistributedMember> adviseProfileExchange(); @Override Set<InternalDistributedMember> adviseProfileUpdate(); @Override void close(); InternalDistributedMember getPrimary(); void notPrimary(InternalDistributedMember member); ProxyBucketRegion getProxyBucketRegion(); boolean isPrimary(); boolean isHosting(); void volunteerForPrimary(); boolean becomePrimary(boolean isRebalance); InternalDistributedMember basicGetPrimaryMember(); boolean waitForRedundancy(int minRedundancy); synchronized void initializePrimaryElector(InternalDistributedMember newPrimaryElector); InternalDistributedMember getPrimaryElector(); int getBucketRedundancy(); @Override Set adviseDestroyRegion(); Set<InternalDistributedMember> adviseRequiresTwoMessages(); @Override Set adviseNetWrite(); @Override String toString(); @Override void addMembershipAndProxyListener(MembershipListener listener); @Override void removeMembershipAndProxyListener(MembershipListener listener); boolean isShadowBucketDestroyed(String shadowBucketPath);  }
@Test public void isShadowBucketDestroyedShouldReturnCorrectly() { Map<String, Boolean> buckets = of(SEPARATOR + "b1", true, SEPARATOR + "b2", false); BucketAdvisor bucketAdvisor = mockBucketAdvisorWithShadowBucketsDestroyedMap(buckets); assertThat(bucketAdvisor.isShadowBucketDestroyed(SEPARATOR + "b1")).isTrue(); assertThat(bucketAdvisor.isShadowBucketDestroyed(SEPARATOR + "b2")).isFalse(); assertThat(bucketAdvisor.isShadowBucketDestroyed(SEPARATOR + "b5")).isFalse(); }