@Test public void testRemoveListener() { AndroidLocationEngineImpl.AndroidLocationEngineCallbackTransport transport = new AndroidLocationEngineImpl.AndroidLocationEngineCallbackTransport(callback); when(engineImpl.createListener(callback)).thenReturn(transport); locationEngineProxy.getListener(callback); locationEngineProxy.removeListener(callback); assertThat(locationEngineProxy.getListenersCount()).isEqualTo(0); }
@VisibleForTesting T removeListener(@NonNull LocationEngineCallback<LocationEngineResult> callback) { return listeners != null ? listeners.remove(callback) : null; }
LocationEngineProxy implements LocationEngine { @VisibleForTesting T removeListener(@NonNull LocationEngineCallback<LocationEngineResult> callback) { return listeners != null ? listeners.remove(callback) : null; } }
LocationEngineProxy implements LocationEngine { @VisibleForTesting T removeListener(@NonNull LocationEngineCallback<LocationEngineResult> callback) { return listeners != null ? listeners.remove(callback) : null; } LocationEngineProxy(LocationEngineImpl<T> locationEngineImpl); }
LocationEngineProxy implements LocationEngine { @VisibleForTesting T removeListener(@NonNull LocationEngineCallback<LocationEngineResult> callback) { return listeners != null ? listeners.remove(callback) : null; } LocationEngineProxy(LocationEngineImpl<T> locationEngineImpl); @Override void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback); @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull LocationEngineCallback<LocationEngineResult> callback,
                                     @Nullable Looper looper); @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     PendingIntent pendingIntent); @Override void removeLocationUpdates(@NonNull LocationEngineCallback<LocationEngineResult> callback); @Override void removeLocationUpdates(PendingIntent pendingIntent); }
LocationEngineProxy implements LocationEngine { @VisibleForTesting T removeListener(@NonNull LocationEngineCallback<LocationEngineResult> callback) { return listeners != null ? listeners.remove(callback) : null; } LocationEngineProxy(LocationEngineImpl<T> locationEngineImpl); @Override void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback); @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull LocationEngineCallback<LocationEngineResult> callback,
                                     @Nullable Looper looper); @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     PendingIntent pendingIntent); @Override void removeLocationUpdates(@NonNull LocationEngineCallback<LocationEngineResult> callback); @Override void removeLocationUpdates(PendingIntent pendingIntent);  }