### Question:
ListenerUtils { public static void error(Exception e) { log.error("Error in Kafka Listener", e); HiveMetricsHelper.incrementCounter(MetricsConstant.LISTENER_FAILURES); } private  ListenerUtils(); static void success(); static void error(Exception e);  }### Answer:
@Test public void error() { Exception e = new RuntimeException("ABC"); ListenerUtils.error(e); CodahaleMetrics metrics = (CodahaleMetrics) MetricsFactory.getInstance(); Counter counter = metrics.getMetricRegistry() .counter(MetricsConstant.LISTENER_FAILURES); assertThat(counter.getCount()).isEqualTo(1L); List<LoggingEvent> events = appender.getEvents(); assertThat(events).hasSize(1); assertThat(events).extracting("renderedMessage").containsExactly("Error in Kafka Listener"); }