### Question:
ZooKeeperMetricsImpl implements ZooKeeperMetrics { @Override public void connectionStateChanged(final ConnectionState newState) { connectionStateChanged.mark(); connectionStateMeter(newState).mark(); } ZooKeeperMetricsImpl(final String group, final MetricRegistry registry); @Override void zookeeperTransientError(); @Override void updateTimer(final String name, final long duration, final TimeUnit timeUnit); @Override void connectionStateChanged(final ConnectionState newState);  }### Answer:
@Test public void testConnectionStateChanged() throws Exception { metrics.connectionStateChanged(ConnectionState.SUSPENDED); metrics.connectionStateChanged(ConnectionState.RECONNECTED); assertThat(registry.getMeters(), allOf( hasKey("group.zookeeper.connection_state_changed"), hasKey("group.zookeeper.connection_state_SUSPENDED"), hasKey("group.zookeeper.connection_state_RECONNECTED") )); assertEquals(2, registry.meter("group.zookeeper.connection_state_changed").getCount()); assertEquals(1, registry.meter("group.zookeeper.connection_state_SUSPENDED").getCount()); assertEquals(1, registry.meter("group.zookeeper.connection_state_RECONNECTED").getCount()); }