private void assertCloseCleanup() {
    assertEquals("Exactly one chunkFiller thread should be running before the router is closed", 1,
        TestUtils.numThreadsByThisName("ChunkFillerThread"));
    assertEquals("Exactly two RequestResponseHandler thread should be running before the router is closed", 2,
        TestUtils.numThreadsByThisName("RequestResponseHandlerThread"));
    router.close();
    assertEquals("No ChunkFiller Thread should be running after the router is closed", 0,
        TestUtils.numThreadsByThisName("ChunkFillerThread"));
    assertEquals("No RequestResponseHandler should be running after the router is closed", 0,
        TestUtils.numThreadsByThisName("RequestResponseHandlerThread"));
    assertEquals("All operations should have completed", 0, router.getOperationsCount());
  }
Asserts that expected threads are running before the router is closed, and that they are not running after the
router is closed.
ambry-router/src/test/java/com/github/ambry/router/PutManagerTest.java