BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { @Override public void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted) { Log.d(TAG, "onProvideBluetoothMacAddressResult: Operation with request ID \"" + requestId + (wasCompleted ? "\" was completed" : "\" was not completed")); stopProvideBluetoothMacAddressMode(); mDiscoveryManager.onProvideBluetoothMacAddressResult(requestId, wasCompleted); } 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 testOnProvideBluetoothMacAddressResult() throws Exception { String rqId = "rqId"; Field fieldGattManager = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mBluetoothGattManager"); fieldGattManager.setAccessible(true); fieldGattManager.set(mBluetoothMacAddressResolutionHelper, mMockBluetoothGattManager); mBluetoothMacAddressResolutionHelper.onProvideBluetoothMacAddressResult(rqId, true); verify(mMockDiscoveryManager, times(1)).onProvideBluetoothMacAddressResult(rqId, true); verify(mMockDiscoveryManager, times(1)).onProvideBluetoothMacAddressModeStartedChanged(false); verify(mMockBluetoothGattManager, times(1)).clearBluetoothGattClientOperationQueue(); }