@Test
public void onBondStateChangedNone() throws Exception {

    connectAndGetCallback();
    Field field = BluetoothPeripheral.class.getDeclaredField("bondStateReceiver");
    field.setAccessible(true);
    BroadcastReceiver broadcastReceiver = (BroadcastReceiver) field.get(peripheral);
    Intent intent = mock(Intent.class);
    when(intent.getAction()).thenReturn(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
    when(intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR)).thenReturn(BluetoothDevice.BOND_NONE);
    when(intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE)).thenReturn(device);
    broadcastReceiver.onReceive(context, intent);
    verify(gatt).disconnect();
}