### Question:
FrameworkJobSchedulerService extends JobService { @SuppressWarnings("unused") public static FrameworkScheduler createSchedulerFor( @SuppressWarnings("UnusedParameters") Context appContext, Class<? extends FrameworkJobSchedulerService> klass) { if (FrameworkJobSchedulerService.class == klass) { throw new IllegalArgumentException("You must create a service that extends" + " FrameworkJobSchedulerService"); } return new FrameworkScheduler(klass); }  @SuppressWarnings("unused") static FrameworkScheduler createSchedulerFor(
            @SuppressWarnings("UnusedParameters") Context appContext,
            Class<? extends FrameworkJobSchedulerService> klass); @Override void onCreate(); @Override void onDestroy(); @Override boolean onStartJob(JobParameters params); @Override boolean onStopJob(JobParameters params);  }### Answer:
@Test public void createScheduler() { FrameworkScheduler scheduler = FrameworkJobSchedulerService .createSchedulerFor(RuntimeEnvironment.application, FrameworkJobSchedulerServiceImpl.class); assertThat(scheduler.serviceImpl == FrameworkJobSchedulerServiceImpl.class, is(true)); }
@Test(expected = IllegalArgumentException.class) public void createBadScheduler() { FrameworkJobSchedulerService.createSchedulerFor(RuntimeEnvironment.application, FrameworkJobSchedulerService.class); }