MemberLevelDiskMonitor extends MBeanStatsMonitor { @Override public Number getStatistic(String name) { if (name.equals(StatsKey.DISK_READ_BYTES)) { return getDiskReadBytes(); } if (name.equals(StatsKey.DISK_WRITEN_BYTES)) { return getDiskWrittenBytes(); } if (name.equals(StatsKey.BACKUPS_IN_PROGRESS)) { return getBackupsInProgress(); } if (name.equals(StatsKey.BACKUPS_COMPLETED)) { return getBackupsCompleted(); } if (name.equals(StatsKey.FLUSHED_BYTES)) { return getFlushedBytes(); } if (name.equals(StatsKey.NUM_FLUSHES)) { return getFlushes(); } if (name.equals(StatsKey.TOTAL_FLUSH_TIME)) { return getFlushTime(); } if (name.equals(StatsKey.DISK_QUEUE_SIZE)) { return getQueueSize(); } return 0; } MemberLevelDiskMonitor(String name); long getFlushes(); int getQueueSize(); int getBackupsCompleted(); int getBackupsInProgress(); @Override Number getStatistic(String name); @Override void addStatisticsToMonitor(Statistics stats); @Override void stopListener(); @Override void removeStatisticsFromMonitor(Statistics stats);  }
@Test public void getStatisticShouldReturnZeroForUnknownStatistics() { assertThat(memberLevelDiskMonitor.getStatistic("unhandledStatistic")).isEqualTo(0); }