private ArgumentCaptor<Intent> mockPackageManagerInfo() {
    PackageManager packageManager = mock(PackageManager.class);
    when(mMockContext.getPackageManager()).thenReturn(packageManager);
    ArgumentCaptor<Intent> intentArgCaptor = ArgumentCaptor.forClass(Intent.class);

    ResolveInfo info = new ResolveInfo();
    info.serviceInfo = new ServiceInfo();
    info.serviceInfo.enabled = true;

    // noinspection WrongConstant
    when(packageManager.queryIntentServices(intentArgCaptor.capture(), eq(0)))
        .thenReturn(Arrays.asList(info));

    return intentArgCaptor;
  }
Tests for the {@link GooglePlayDriver} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/GooglePlayDriverTest.java