GooglePlayReceiver extends Service implements ExecutionDelegator.JobFinishedCallback { @Override public void onJobFinished(@NonNull JobInvocation js, @JobResult int result) { try { JobCallback callback; synchronized (callbacks) { SimpleArrayMap<String, JobCallback> map = callbacks.get(js.getService()); if (map == null) { return; } callback = map.remove(js.getTag()); if (callback == null) { return; } if (map.isEmpty()) { callbacks.remove(js.getService()); } } if (needsToBeRescheduled(js, result)) { reschedule(js); } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "sending jobFinished for " + js.getTag() + " = " + result); } sendResultSafely(callback, result); } } finally { synchronized (callbacks) { if (callbacks.isEmpty()) { stopSelf(latestStartId); } } } }  @Override final int onStartCommand(Intent intent, int flags, int startId); @Nullable @Override IBinder onBind(Intent intent); @Override void onJobFinished(@NonNull JobInvocation js, @JobResult int result);  }
@Test public void onJobFinished_unknownJobCallbackIsNotPresent_ignoreNoException() { receiver.onJobFinished(jobInvocationBuilder.build(), JobService.RESULT_SUCCESS); verifyZeroInteractions(driverMock); }