@Test
  public void onStartCommand_executeAction() {
    JobInvocation job =
        new JobInvocation.Builder()
            .setTag("tag")
            .setService("com.example.foo.FooService")
            .setTrigger(Trigger.NOW)
            .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)
            .setLifetime(Lifetime.UNTIL_NEXT_BOOT)
            .setConstraints(new int[] {Constraint.DEVICE_IDLE})
            .build();

    Intent execIntent =
        new Intent("com.google.android.gms.gcm.ACTION_TASK_READY")
            .putExtra(
                "extras",
                new JobCoder(BundleProtocol.PACKED_PARAM_BUNDLE_PREFIX).encode(job, new Bundle()))
            .putExtra("callback", new InspectableBinder().toPendingCallback());

    assertResultWasStartNotSticky(receiver.onStartCommand(execIntent, 0, 101));

    verify(receiver, never()).stopSelf(anyInt());
    verify(executionDelegatorMock).executeJob(any(JobInvocation.class));

    receiver.onJobFinished(job, JobService.RESULT_SUCCESS);

    verify(receiver).stopSelf(101);
  }
The default ShadowMessenger implementation causes NPEs when using the {@link
Messenger#Messenger(Handler)} constructor. We create our own empty Shadow so we can just use
the standard Android implementation, which is totally fine.

@see <a href="https://github.com/robolectric/robolectric/issues/2246">Robolectric issue</a>
jobdispatcher/src/test/java/com/firebase/jobdispatcher/GooglePlayReceiverTest.java