@Test
  public void testOnStartCommand_handlesStartJob_doNotStartRunningJobAgain() throws Exception {
    StoppableJobService service = new StoppableJobService(/* shouldReschedule= */ false);

    Job jobSpec =
        TestUtil.getBuilderWithNoopValidator()
            .setTag("tag")
            .setService(StoppableJobService.class)
            .setTrigger(Trigger.NOW)
            .build();

    Bundle jobSpecData = getJobCoder().encode(jobSpec, new Bundle());
    IRemoteJobService.Stub.asInterface(service.onBind(null)).start(jobSpecData, null);
    IRemoteJobService.Stub.asInterface(service.onBind(null)).start(jobSpecData, null);

    flush(service);

    assertEquals(1, service.getNumberOfStartRequestsReceived());
  }
Tests for the {@link JobService} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/JobServiceTest.java