shadows/framework/src/main/java/org/robolectric/shadows/ShadowBluetoothHeadset.java
@Implementation
  protected int getConnectionState(BluetoothDevice device) {
    return connectedDevices.contains(device)
        ? BluetoothProfile.STATE_CONNECTED
        : BluetoothProfile.STATE_DISCONNECTED;
  }
@Implementation
  protected int getConnectionState(BluetoothDevice device) {
    return connectedDevices.contains(device)
        ? BluetoothProfile.STATE_CONNECTED
        : BluetoothProfile.STATE_DISCONNECTED;
  }
Overrides behavior of {@link getConnectionState}.

@return {@code BluetoothProfile.STATE_CONNECTED} if the given device has been previously added
by a call to {@link ShadowBluetoothHeadset#addConnectedDevice}, and {@code
BluetoothProfile.STATE_DISCONNECTED} otherwise.