### Question:
GcmScheduler extends Scheduler { int onStartJob(TaskParams taskParams) { SchedulerConstraint constraint = null; try { constraint = fromBundle(taskParams.getExtras()); } catch (Exception e) { JqLog.e(e, "bad bundle from GcmScheduler. Ignoring the call"); return GcmNetworkManager.RESULT_SUCCESS; } if (JqLog.isDebugEnabled()) { JqLog.d("starting job %s", constraint); } ResultCallback callback = new ResultCallback(); constraint.setData(callback); start(constraint); return callback.get() ? GcmNetworkManager.RESULT_RESCHEDULE : GcmNetworkManager.RESULT_SUCCESS; } GcmScheduler(Context context, Class<? extends GcmJobSchedulerService> serviceClass); @Override void request(SchedulerConstraint constraint); @Override void cancelAll(); @Override void onFinished(SchedulerConstraint constraint, boolean reschedule);  }### Answer:
@Test public void badBundleOnStart() { TaskParams params = mock(TaskParams.class); PersistableBundle badBundle = mock(PersistableBundle.class); when(badBundle.getString(anyString(), anyString())).thenThrow(new NullPointerException()); when(badBundle.getString(anyString())).thenThrow(new NullPointerException()); assertThat(gcmScheduler.onStartJob(params), is(GcmNetworkManager.RESULT_SUCCESS)); }