### Question:
RequestDispatcher extends AbstractExecutorService { public void submitResults(Runnable command) { if (mCallbackExecutor != null) { mCallbackExecutor.execute(command); } else if (mHandler.getLooper() == Looper.myLooper()) { command.run(); } else { mHandler.post(command); } } RequestDispatcher(Executor callbackExecutor); @Override void shutdown(); void stopAllTasks(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override boolean awaitTermination(long timeout, TimeUnit unit); void submitResults(Runnable command); @Override Future<?> submit(Runnable task); @Override void execute(Runnable command); void runTask(Runnable runnable); @VisibleForTesting(otherwise = VisibleForTesting.NONE) static String createStackElementTagFor(Thread thread);  }### Answer:
@Test public void submitResults() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); long current_tid = Thread.currentThread().getId(); final long[] dispatcher_tid = new long[1]; final long[] callback_tid = new long[1]; mDispatcher.submit(() -> { dispatcher_tid[0] = Thread.currentThread().getId(); }); mDispatcher.submitResults(() -> { callback_tid[0] = Thread.currentThread().getId(); latch.countDown(); }); latch.await(); assertNotEquals(dispatcher_tid[0], current_tid); assertNotEquals(callback_tid[0], current_tid); assertNotEquals(callback_tid[0], dispatcher_tid[0]); }