@Test
  public void testExtractCallback_goodParcelable() {
    InspectableBinder binder = new InspectableBinder();
    Bundle validBundle = new Bundle();
    validBundle.putParcelable("callback", binder.toPendingCallback());

    Pair<JobCallback, Bundle> extraction = extractCallback(validBundle);
    assertNotNull(extraction);
    assertEquals(
        "should have stripped the 'callback' entry from the extracted bundle",
        0,
        extraction.second.keySet().size());
    extraction.first.jobFinished(JobService.RESULT_SUCCESS);

    // Check our homemade Binder is doing the right things:
    TransactionArguments args = binder.getArguments().get(0);
    // Should have set the transaction code:
    assertEquals("transaction code", IBinder.FIRST_CALL_TRANSACTION + 1, args.code);

    // strong mode bit
    args.data.readInt();
    // interface token
    assertEquals("com.google.android.gms.gcm.INetworkTaskCallback", args.data.readString());
    // result
    assertEquals("result", JobService.RESULT_SUCCESS, args.data.readInt());
  }
ShadowParcel doesn't correctly handle {@link Parcel#writeStrongBinder(IBinder)} or {@link
Parcel#readStrongBinder()}, so we shim a simple implementation that uses an in-memory map to
read and write Binder objects.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/GooglePlayCallbackExtractorTest.java