AggregateRegionStatsMonitor extends MBeanStatsMonitor { @Override public Number getStatistic(String name) { if (name.equals(StatsKey.LRU_EVICTIONS)) { return getLruEvictions(); } if (name.equals(StatsKey.LRU_DESTROYS)) { return getLruDestroys(); } if (name.equals(StatsKey.PRIMARY_BUCKET_COUNT)) { return getTotalPrimaryBucketCount(); } if (name.equals(StatsKey.BUCKET_COUNT)) { return getTotalBucketCount(); } if (name.equals(StatsKey.TOTAL_BUCKET_SIZE)) { return getTotalBucketSize(); } if (name.equals(StatsKey.DISK_SPACE)) { return getDiskSpace(); } return 0; } AggregateRegionStatsMonitor(String name); long getDiskSpace(); int getTotalBucketCount(); int getTotalBucketSize(); int getTotalPrimaryBucketCount(); void removeLRUStatistics(Statistics stats); void removeDirectoryStatistics(Statistics stats); void removePartitionStatistics(Statistics stats); @Override Number getStatistic(String name); @Override void addStatisticsToMonitor(Statistics stats); @Override void stopListener(); @Override void removeStatisticsFromMonitor(Statistics stats);  }
@Test public void getStatisticShouldReturnZeroForUnknownStatistics() { assertThat(aggregateRegionStatsMonitor.getStatistic("unhandledStatistic")).isEqualTo(0); }