### Question:
MetricUtil { public static MetricsStopWatch getMetricsStopWatch(boolean isRequestMetricsEnabled, LogLevel connectionLogLevel, MetricType type) { if(!type.isLoggingEnabled(connectionLogLevel) && !isRequestMetricsEnabled) { return new MetricsStopWatch(false); } return new MetricsStopWatch(true); }  static CombinableMetric getCombinableMetric(boolean isRequestMetricsEnabled,
                                                       LogLevel connectionLogLevel,
                                                       MetricType type); static MetricsStopWatch getMetricsStopWatch(boolean isRequestMetricsEnabled,
                                                       LogLevel connectionLogLevel,
                                                       MetricType type);  }### Answer:
@Test public void testGetMetricsStopWatchWithMetricsTrue() throws Exception { MetricsStopWatch metricsStopWatch = MetricUtil.getMetricsStopWatch(true, LogLevel.OFF, WALL_CLOCK_TIME_MS); assertTrue(metricsStopWatch.getMetricsEnabled()); metricsStopWatch.start(); metricsStopWatch = MetricUtil.getMetricsStopWatch(false, LogLevel.INFO, RESULT_SET_TIME_MS); assertTrue(metricsStopWatch.getMetricsEnabled()); }
@Test public void testGetMetricsStopWatchWithMetricsFalse() throws Exception { MetricsStopWatch metricsStopWatch = MetricUtil.getMetricsStopWatch(false, LogLevel.OFF, WALL_CLOCK_TIME_MS); assertFalse(metricsStopWatch.getMetricsEnabled()); }