### Question:
GoogleLocationEngineImpl implements LocationEngineImpl<LocationCallback> { @Override public void removeLocationUpdates(@NonNull LocationCallback listener) { if (listener != null) { fusedLocationProviderClient.removeLocationUpdates(listener); } } @VisibleForTesting  GoogleLocationEngineImpl(FusedLocationProviderClient fusedLocationProviderClient);   GoogleLocationEngineImpl(@NonNull Context context); @NonNull @Override LocationCallback createListener(LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull LocationCallback listener,
                                     @Nullable Looper looper); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull PendingIntent pendingIntent); @Override void removeLocationUpdates(@NonNull LocationCallback listener); @Override void removeLocationUpdates(PendingIntent pendingIntent);  }### Answer:
@Test public void removeLocationUpdatesForInvalidListener() { LocationEngineCallback<LocationEngineResult> callback = mock(LocationEngineCallback.class); engine.removeLocationUpdates(callback); verify(fusedLocationProviderClientMock, never()).removeLocationUpdates(any(LocationCallback.class)); }
@Test public void removeLocationUpdatesForPendingIntent() { PendingIntent pendingIntent = mock(PendingIntent.class); engine.removeLocationUpdates(pendingIntent); verify(fusedLocationProviderClientMock, times(1)) .removeLocationUpdates(any(PendingIntent.class)); }