### Question:
BoltConnectionQueueMonitorAggregate implements BoltConnectionQueueMonitor { @Override public void drained( BoltConnection from, Collection<Job> batch ) { monitors.forEach( m -> m.drained( from, batch ) ); } BoltConnectionQueueMonitorAggregate( BoltConnectionQueueMonitor... monitors ); @Override void enqueued( BoltConnection to, Job job ); @Override void drained( BoltConnection from, Collection<Job> batch );  }### Answer:
@Test public void shouldCallDrainedOnSingleMonitor() { Collection<Job> batch = new ArrayList<>(); BoltConnectionQueueMonitor monitor = mock( BoltConnectionQueueMonitor.class ); BoltConnectionQueueMonitorAggregate monitorAggregate = new BoltConnectionQueueMonitorAggregate( monitor ); monitorAggregate.drained( connection, batch ); verify( monitor ).drained( connection, batch ); }
@Test public void shouldCallDrainedOnEachMonitor() { Collection<Job> batch = new ArrayList<>(); BoltConnectionQueueMonitor monitor1 = mock( BoltConnectionQueueMonitor.class ); BoltConnectionQueueMonitor monitor2 = mock( BoltConnectionQueueMonitor.class ); BoltConnectionQueueMonitorAggregate monitorAggregate = new BoltConnectionQueueMonitorAggregate( monitor1, monitor2 ); monitorAggregate.drained( connection, batch ); verify( monitor1 ).drained( connection, batch ); verify( monitor2 ).drained( connection, batch ); }