@Test
public void androidGpsLocationClientOnLocationChangedShouldCallRegisteredLocationListenerAndUpdateLastLocation() {

    androidGpsLocationClient = new AndroidGpsLocationClient(RuntimeEnvironment.application);
    LocationListener locationListener = Mockito.mock(LocationListener.class);
    LocationListener locationListener2 = Mockito.mock(LocationListener.class);
    // Mock call to KujakuLibrary.showToast
    KujakuLibrary kujakuLibrary = Mockito.mock(KujakuLibrary.class);
    ReflectionHelpers.setStaticField(KujakuLibrary.class, "library", kujakuLibrary);
    Mockito.doNothing().when(kujakuLibrary).showToast(Mockito.anyString());
    // Create a mock location
    Location location = new Location(LocationManager.GPS_PROVIDER);
    location.setAccuracy(4f);
    location.setAltitude(23f);
    location.setLatitude(3d);
    location.setLongitude(1d);
    // Set the location listeners supposed to receive updates
    androidGpsLocationClient.addLocationListener(locationListener);
    androidGpsLocationClient.setLocationListener(locationListener2);
    // Retrieve the androidGpsLocationListener from the AndroidGpsLocationClient
    AndroidGpsLocationClient.AndroidGpsLocationListener androidGpsLocationListener = ReflectionHelpers.getField(androidGpsLocationClient, "androidGpsLocationListener");
    // Call onLocationChanged on the androidGpsLocationListener
    androidGpsLocationListener.onLocationChanged(location);
    Mockito.verify(locationListener).onLocationChanged(location);
    Mockito.verify(locationListener2).onLocationChanged(location);
    Assert.assertEquals(location, androidGpsLocationClient.getLastLocation());
}