@Deprecated
    @TargetApi(18)
    public void stopRangingBeaconsInRegion(@NonNull Region region) throws RemoteException {
        LogManager.d(TAG, "API stopRangingBeacons "+region);
        LogManager.d(TAG, "stopRangingBeaconsInRegion");
        if (!isBleAvailableOrSimulated()) {
            LogManager.w(TAG, "Method invocation will be ignored.");
            return;
        }
        if (determineIfCalledFromSeparateScannerProcess()) {
            return;
        }
        rangedRegions.remove(region);
        applyChangesToServices(BeaconService.MSG_STOP_RANGING, region);
    }
@Test
  public void stopRangingBeaconsInRegionTest() throws Exception {
    BeaconManager beaconManager = BeaconManager
        .getInstanceForApplication(RuntimeEnvironment.application);

    String id = "id";
    Region region1 = new Region(id, Collections.<Identifier>emptyList());
    Region region2 = new Region(id, "00:11:22:33:FF:EE");
    Region region3 = new Region(id + "-other", Collections.<Identifier>emptyList());

    beaconManager.startRangingBeaconsInRegion(region1);
    beaconManager.startRangingBeaconsInRegion(region2);
    beaconManager.startRangingBeaconsInRegion(region3);
    assertEquals(beaconManager.getRangedRegions().size(), 2);

    beaconManager.stopRangingBeaconsInRegion(region1);
    assertEquals(beaconManager.getRangedRegions().size(), 1);

    beaconManager.stopRangingBeaconsInRegion(region3);
    assertEquals(beaconManager.getRangedRegions().size(), 0);
  }