### Question:
NodeMetricHolder implements Closeable { public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } } NodeMetricHolder(MetricRegistry metricRegistry, TableStorageStates tableStorageStates); void repairState(TableReference tableReference, double repairRatio); void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful); @Override void close();  }### Answer:
@Test public void testUpdateRepairTimingSuccessful() { long expectedTime = 1234; boolean successful = true; myNodeMetricHolder.repairTiming(expectedTime, TimeUnit.NANOSECONDS, successful); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getCount()).isEqualTo(1); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getSnapshot().getMean()).isEqualTo(expectedTime); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getCount()).isEqualTo(0); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getSnapshot().getMean()).isEqualTo(0); }
@Test public void testUpdateRepairTimingFailed() { long expectedTime = 1234; boolean successful = false; myNodeMetricHolder.repairTiming(expectedTime, TimeUnit.NANOSECONDS, successful); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getCount()).isEqualTo(1); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getSnapshot().getMean()).isEqualTo(expectedTime); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getCount()).isEqualTo(0); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getSnapshot().getMean()).isEqualTo(0); }