### Question:
CloudWatchPublisherRunnable implements Runnable { public void shutdown() { log.info("Shutting down CWPublication thread."); synchronized (queue) { shuttingDown = true; queue.notify(); } } CloudWatchPublisherRunnable(CloudWatchMetricsPublisher metricsPublisher,
                                       long bufferTimeMillis,
                                       int maxQueueSize,
                                       int batchSize);  CloudWatchPublisherRunnable(CloudWatchMetricsPublisher metricsPublisher,
                                       long bufferTimeMillis,
                                       int maxQueueSize,
                                       int batchSize,
                                       int maxJitter); @Override void run(); void runOnce(); void shutdown(); boolean isShutdown(); void enqueue(Collection<MetricDatumWithKey<CloudWatchMetricKey>> data);  }### Answer:
@Test public void testShutdown() { harness.enqueueRandom(FLUSH_SIZE + 1); harness.getRunnable().shutdown(); harness.runAndAssert(0, FLUSH_SIZE); Assert.assertFalse(harness.getRunnable().isShutdown()); harness.runAndAssert(FLUSH_SIZE, 1); Assert.assertTrue(harness.getRunnable().isShutdown()); }