@Override
          public void testAndAssert(RouterErrorCode expectedError) throws Exception {
            final CountDownLatch callbackCalled = new CountDownLatch(1);
            List<Future> futures = new ArrayList<>();
            for (int i = 0; i < 5; i++) {
              if (i == 1) {
                futures.add(router.deleteBlob(null, blobIdString, null, new Callback<Void>() {
                  @Override
                  public void onCompletion(Void result, Exception exception) {
                    callbackCalled.countDown();
                    throw new RuntimeException("Throwing an exception in the user callback");
                  }
                }, quotaChargeCallback));
              } else {
                futures.add(router.deleteBlob(blobIdString, null));
              }
            }
            for (Future future : futures) {
              future.get(AWAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
            }
            long waitStart = SystemTime.getInstance().milliseconds();
            while (router.getBackgroundOperationsCount() != 0
                && SystemTime.getInstance().milliseconds() < waitStart + AWAIT_TIMEOUT_SECONDS * 1000) {
              Thread.sleep(1000);
            }
            Assert.assertTrue("Callback not called.", callbackCalled.await(AWAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS));
            Assert.assertEquals("All operations should be finished.", 0, router.getOperationsCount());
            Assert.assertTrue("Router should not be closed", router.isOpen());

            //Test that DeleteManager is still operational
            router.deleteBlob(blobIdString, null).get();
          }
Test that a bad user defined callback will not crash the router.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/DeleteManagerTest.java