/**
   * Test that all fine
   *
   * @throws SecurityException
   */
  @Test
  public void getLastLocation_Success() throws SecurityException {
    final Location expectedLocation = buildFakeLocation(provider);

    Mockito.when(locationManager.getLastKnownLocation(provider)).thenReturn(expectedLocation);

    final RxLocationManager rxLocationManager = getDefaullRxLocationManager();

    final TestSubscriber<Location> subscriber = new TestSubscriber<>();
    rxLocationManager.getLastLocation(provider).subscribe(subscriber);
    subscriber.awaitTerminalEvent();
    subscriber.assertCompleted();
    subscriber.assertValue(expectedLocation);
  }
  /**
   * Test that getLastLocation throw ElderLocationException if howOldCanBe is provided
   *
   * @throws SecurityException
   */
  @Test
  public void getLastLocation_Old() throws SecurityException {
    final Location expectedLocation = buildFakeLocation(provider);
    expectedLocation.setTime(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1));

    Mockito.when(locationManager.getLastKnownLocation(provider)).thenReturn(expectedLocation);

    final RxLocationManager rxLocationManager = getDefaullRxLocationManager();

    final TestSubscriber<Location> subscriber = new TestSubscriber<>();
    rxLocationManager
        .getLastLocation(provider, new LocationTime(30, TimeUnit.MINUTES))
        .subscribe(subscriber);
    subscriber.awaitTerminalEvent();
    subscriber.assertError(ElderLocationException.class);
  }