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