### Question:
BatchingMessageHandler implements Runnable, LifecycleMessageHandler<ReceivedInstantClusterIdAwareMessage<?>> { @Override public void stop() throws Throwable { stopped = true; handler.stop(); job.stop(); } BatchingMessageHandler( LifecycleMessageHandler<ReceivedInstantClusterIdAwareMessage<?>> handler,
            BoundedPriorityQueue.Config inQueueConfig, Config batchConfig, Function<Runnable,ContinuousJob> jobFactory,
            LogProvider logProvider ); @Override void start( ClusterId clusterId ); @Override void stop(); @Override void handle( ReceivedInstantClusterIdAwareMessage<?> message ); @Override void run();  }### Answer:
@Test public void shouldDelegateStop() throws Throwable { BatchingMessageHandler batchHandler = new BatchingMessageHandler( downstreamHandler, IN_QUEUE_CONFIG, BATCH_CONFIG, jobSchedulerFactory, NullLogProvider.getInstance() ); batchHandler.stop(); Mockito.verify( downstreamHandler ).stop(); }
@Test public void shouldStopJob() throws Throwable { BatchingMessageHandler batchHandler = new BatchingMessageHandler( downstreamHandler, IN_QUEUE_CONFIG, BATCH_CONFIG, jobSchedulerFactory, NullLogProvider.getInstance() ); batchHandler.stop(); Mockito.verify( mockJob ).stop(); }