### Question:
MonitorImpl extends HostListener implements Monitor { protected void notifyAlertListeners() { for ( AlertEvent alertEvent : alerts ) { if ( !alertEvent.isDelivered() && !alertEvent.isExpired() ) { for ( AlertListener alertListener : alertListeners ) { AlertNotifier alertNotifier = new AlertNotifier( alertEvent, alertListener ); notificationExecutor.submit( alertNotifier ); } alertEvent.setDelivered( true ); } } } MonitorImpl( PeerManager peerManager, DaoManager daoManager, HostRegistry hostRegistry ); void addAlertListener( AlertListener alertListener ); void removeAlertListener( AlertListener alertListener ); @Override Set<AlertListener> getAlertListeners(); void destroy(); @Override String getHistoricalMetrics( final Host host, final Date startTime, final Date endTime ); @Override void addAlert( final AlertEvent alert ); @Override ResourceHostMetrics getResourceHostMetrics(); @Override ResourceHostMetric getResourceHostMetric( final ResourceHost resourceHost ); @Override Collection<AlertEvent> getAlertEvents(); @Override List<AlertEvent> getAlertsQueue(); @Override void onHeartbeat( final ResourceHostInfo resourceHostInfo, final Set<QuotaAlertValue> alerts ); @Override void putAlert( final Alert alert ); @Override List<P2PInfo> getP2PStatuses(); @Override P2PInfo getP2pStatus( String rhId ); @Override HistoricalMetrics getMetricsSeries( final Host host, Date startTime, Date endTime );  }### Answer:
@Test public void testNotify() throws Exception { ArgumentCaptor<AlertNotifier> alertNotifierArgumentCaptor = ArgumentCaptor.forClass( AlertNotifier.class ); monitor.notifyAlertListeners(); verify( notificationService ).execute( alertNotifierArgumentCaptor.capture() ); assertEquals( alertListener, alertNotifierArgumentCaptor.getValue().listener ); assertEquals( alert, alertNotifierArgumentCaptor.getValue().alert ); }