BucketRedundancyTracker { synchronized void updateStatistics(int currentBucketHosts) { updateRedundancyStatistics(currentBucketHosts); updateNoCopiesStatistics(currentBucketHosts); } BucketRedundancyTracker(int redundantCopies,
      PartitionedRegionRedundancyTracker regionRedundancyTracker);   }
@Test public void whenRedundancyNeverMetDoesNotWarnOnLowRedundancy() { bucketRedundancyTracker.updateStatistics(TARGET_COPIES - 1); verify(regionRedundancyTracker, never()).reportBucketCount(anyInt()); }
@Test public void updatesRedundancyOnlyIfChanged() { bucketRedundancyTracker.updateStatistics(TARGET_COPIES - 1); verify(regionRedundancyTracker, times(1)).setActualRedundancy(TARGET_COPIES - 2); bucketRedundancyTracker.updateStatistics(TARGET_COPIES); verify(regionRedundancyTracker, times(1)).setActualRedundancy(TARGET_COPIES - 1); bucketRedundancyTracker.updateStatistics(TARGET_COPIES); verify(regionRedundancyTracker, times(2)).setActualRedundancy(anyInt()); }