@Test
  public void testDelayedSubmit() throws Throwable {
    String message = "inject error";
    thrown.expect(RuntimeException.class);
    thrown.expectMessage(message);
    dispatcher.submitTask(new Runnable() {

      @Override
      public void run() {
        throw new RuntimeException(message);
      }
    }, 100, TimeUnit.MILLISECONDS);
    handler.get();
  }
Make sure the {@link UncaughtExceptionHandler} will be called when there are unchecked exceptions
thrown in the task.
<p/>
See HBASE-21875 and HBASE-21890 for more details.
hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestRemoteProcedureDispatcherUncaughtExceptionHandler.java