### Question:
TableMetricHolder 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); } myNodeMetricHolder.repairTiming(timeTaken, timeUnit, successful); } TableMetricHolder(TableReference tableReference, MetricRegistry metricRegistry, NodeMetricHolder nodeMetricHolder); void init(); void repairState(int repairedRanges, int notRepairedRanges); void lastRepairedAt(long lastRepairedAt); void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful); @Override void close();  }### Answer:
@Test public void testUpdateRepairTimingSuccessful() { boolean successful = true; long timeTaken = 1234; myTableMetricHolder.repairTiming(timeTaken, TimeUnit.NANOSECONDS, successful); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_SUCCESS).getCount()).isEqualTo(1); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_SUCCESS).getSnapshot().getMean()).isEqualTo(timeTaken); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_FAILED).getCount()).isEqualTo(0); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_FAILED).getSnapshot().getMean()).isEqualTo(0); verify(myNodeMetricHolder).repairTiming(eq(timeTaken), eq(TimeUnit.NANOSECONDS), eq(successful)); }
@Test public void testUpdateRepairTimingFailed() { boolean successful = false; long timeTaken = 1234; myTableMetricHolder.repairTiming(timeTaken, TimeUnit.NANOSECONDS, successful); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_FAILED).getCount()).isEqualTo(1); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_FAILED).getSnapshot().getMean()).isEqualTo(timeTaken); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_SUCCESS).getCount()).isEqualTo(0); assertThat(getTimer(TableMetricHolder.REPAIR_TIMING_SUCCESS).getSnapshot().getMean()).isEqualTo(0); verify(myNodeMetricHolder).repairTiming(eq(timeTaken), eq(TimeUnit.NANOSECONDS), eq(successful)); }