BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { public synchronized void stopReceiveBluetoothMacAddressMode() { if (mReceiveBluetoothMacAddressTimeoutTimer != null) { mReceiveBluetoothMacAddressTimeoutTimer.cancel(); mReceiveBluetoothMacAddressTimeoutTimer = null; } mIsReceiveBluetoothMacAddressModeStarted = false; mDiscoveryManager.onReceiveBluetoothMacAddressModeStartedChanged(false); } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); UUID getProvideBluetoothMacAddressRequestUuid(); String getCurrentProvideBluetoothMacAddressRequestId(); boolean getIsProvideBluetoothMacAddressModeStarted(); boolean getIsBluetoothMacAddressGattServerStarted(); boolean getIsReceiveBluetoothMacAddressModeStarted(); synchronized void stopAllBluetoothMacAddressResolutionOperations(); synchronized boolean startProvideBluetoothMacAddressMode(String requestId); synchronized void stopProvideBluetoothMacAddressMode(); void provideBluetoothMacAddressToDevice(BluetoothDevice bluetoothDevice); synchronized void startReceiveBluetoothMacAddressMode(String requestId); synchronized void stopReceiveBluetoothMacAddressMode(); void startBluetoothMacAddressGattServer(String requestId); synchronized boolean startBluetoothDeviceDiscovery(); synchronized boolean stopBluetoothDeviceDiscovery(); @Override void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice); @Override void onBluetoothGattClientOperationCountInQueueChanged(int operationCountInQueue); @Override void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted); @Override void onBluetoothMacAddressResolved(String bluetoothMacAddress);  }
@Test public void testStopReceiveBluetoothMacAddressMode() throws Exception { Field field = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mReceiveBluetoothMacAddressTimeoutTimer"); field.setAccessible(true); field.set(mBluetoothMacAddressResolutionHelper, mMockCountDownTimer); mBluetoothMacAddressResolutionHelper.stopReceiveBluetoothMacAddressMode(); verify(mMockCountDownTimer, times(1)).cancel(); assertThat("Is set to null if receive bt mac address properly stopped", field.get(mBluetoothMacAddressResolutionHelper), is(nullValue())); }