@Test
public void getLastLocationShouldReturnCorrectFromCorrectProviderForPriority() {

    // Set-up mock Locations: -------------------------------------------------------------- //
    Location gpsLocation = newMockLocation();
    when(locationManager.getLastKnownLocation(GPS_PROVIDER))
            .thenReturn(gpsLocation);
    Location networkLocation = newMockLocation();
    when(locationManager.getLastKnownLocation(NETWORK_PROVIDER))
            .thenReturn(networkLocation);
    Location passiveLocation = newMockLocation();
    when(locationManager.getLastKnownLocation(PASSIVE_PROVIDER))
            .thenReturn(passiveLocation);
    // High Accuracy: -------------------------------------------------------------- //
    androidLocationClient.setPriority(PRIORITY_HIGH_ACCURACY);
    // W/ GPS
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(GPS_PROVIDER, NETWORK_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), gpsLocation);
    // W/out GPS:
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(NETWORK_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), networkLocation);
    // Balanced Accuracy: -------------------------------------------------------------- //
    androidLocationClient.setPriority(PRIORITY_BALANCED_POWER_ACCURACY);
    // W/ both (should be Network)
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(GPS_PROVIDER, NETWORK_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), networkLocation);
    // W/out Network
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(GPS_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), gpsLocation);
    // Low Power Accuracy: -------------------------------------------------------------- //
    androidLocationClient.setPriority(PRIORITY_LOW_POWER);
    // W/ Network
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(NETWORK_PROVIDER, PASSIVE_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), networkLocation);
    // W/out Network:
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(PASSIVE_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), passiveLocation);
    // No Power: -------------------------------------------------------------- //
    androidLocationClient.setPriority(PRIORITY_NO_POWER);
    // W/ Passive:
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of(PASSIVE_PROVIDER));
    assertSame(androidLocationClient.getLastLocation(), passiveLocation);
    // W/out any Providers:
    when(locationManager.getProviders(true))
            .thenReturn(ImmutableList.of());
    assertNull(androidLocationClient.getLastLocation());
}