### Question:
FrameworkScheduler extends Scheduler { boolean onStopJob(JobParameters params) { SchedulerConstraint constraint; try { constraint = fromBundle(params.getExtras()); } catch (Exception e) { JqLog.e(e, "bad bundle from job scheduler stop callback"); return false; } return stop(constraint); } FrameworkScheduler(Class<? extends FrameworkJobSchedulerService> serviceImpl); @SuppressLint("SwitchIntDef") @Override void request(SchedulerConstraint constraint); @Override void onFinished(SchedulerConstraint constraint, boolean reschedule); @Override void cancelAll();  }### Answer:
@Test public void badBundleOnStop() { JobParameters params = mock(JobParameters.class); PersistableBundle badBundle = mock(PersistableBundle.class); when(badBundle.getString(anyString(), anyString())).thenThrow(new NullPointerException()); when(badBundle.getString(anyString())).thenThrow(new NullPointerException()); assertThat(fwScheduler.onStopJob(params), is(false)); }