### Question:
DropwizardApnsClientMetricsListener implements ApnsClientMetricsListener, MetricSet { @Override public void handleNotificationSent(final ApnsClient apnsClient, final long notificationId) { this.sentNotifications.mark(); this.notificationTimerContexts.put(notificationId, this.notificationTimer.time()); } DropwizardApnsClientMetricsListener(); @Override void handleWriteFailure(final ApnsClient apnsClient, final long notificationId); @Override void handleNotificationSent(final ApnsClient apnsClient, final long notificationId); @Override void handleNotificationAccepted(final ApnsClient apnsClient, final long notificationId); @Override void handleNotificationRejected(final ApnsClient apnsClient, final long notificationId); @Override void handleConnectionAdded(final ApnsClient apnsClient); @Override void handleConnectionRemoved(final ApnsClient apnsClient); @Override void handleConnectionCreationFailed(final ApnsClient apnsClient); @Override Map<String, Metric> getMetrics(); static final String NOTIFICATION_TIMER_NAME; static final String WRITE_FAILURES_METER_NAME; static final String SENT_NOTIFICATIONS_METER_NAME; static final String ACCEPTED_NOTIFICATIONS_METER_NAME; static final String REJECTED_NOTIFICATIONS_METER_NAME; static final String OPEN_CONNECTIONS_GAUGE_NAME; static final String CONNECTION_FAILURES_METER_NAME; }### Answer:
@Test public void testHandleNotificationSent() { final Meter sentNotifications = (Meter) this.listener.getMetrics().get(DropwizardApnsClientMetricsListener.SENT_NOTIFICATIONS_METER_NAME); assertEquals(0, sentNotifications.getCount()); this.listener.handleNotificationSent(null, 1); assertEquals(1, sentNotifications.getCount()); }