@Test
  public void testCancelJob() throws Exception {
    final String tag = "foo";

    // simulate success
    when(driver.cancel(tag)).thenReturn(FirebaseJobDispatcher.CANCEL_RESULT_SUCCESS);

    assertEquals(
        "Expected dispatcher to pass the result of Driver#cancel(String, Class) through",
        FirebaseJobDispatcher.CANCEL_RESULT_SUCCESS,
        dispatcher.cancel(tag));

    // verify the driver was indeed called
    verify(driver).cancel(tag);
  }
Tests for the {@link FirebaseJobDispatcher} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/FirebaseJobDispatcherTest.java