BluetoothUtils { public static boolean isBluetoothMacAddressUnknown(String bluetoothMacAddress) { return (bluetoothMacAddress == null || bluetoothMacAddress.equals(MARSHMALLOW_FAKE_MAC_ADDRESS) || bluetoothMacAddress.equals(PeerProperties.BLUETOOTH_MAC_ADDRESS_UNKNOWN)); }  static boolean isBluetoothMacAddressUnknown(String bluetoothMacAddress); static boolean isValidBluetoothMacAddress(String bluetoothMacAddress); static String getBluetoothMacAddressFromSocket(final BluetoothSocket bluetoothSocket); static PeerProperties validateReceivedHandshakeMessage(
            byte[] handshakeMessage, int handshakeMessageLength, BluetoothSocket bluetoothSocketOfSender); static int getPreviouslyUsedAlternativeChannelOrPort(); static void setNextAlternativeChannelOrPort(int channelOrPort); static BluetoothSocket createBluetoothSocketToServiceRecord(
            BluetoothDevice bluetoothDevice, UUID serviceRecordUuid, int channelOrPort, boolean secure); static BluetoothSocket createBluetoothSocketToServiceRecordWithNextPort(
            BluetoothDevice bluetoothDevice, UUID serviceRecordUuid, boolean secure); static BluetoothSocket createBluetoothSocket(
            BluetoothSocket originalBluetoothSocket, int channelOrPort, boolean secure); static BluetoothSocket createBluetoothSocketWithNextChannel(
            BluetoothSocket originalBluetoothSocket, boolean secure); static final String BLUETOOTH_ADDRESS_SEPARATOR; static final int BLUETOOTH_ADDRESS_BYTE_COUNT; static final int BLUETOOTH_MAC_ADDRESS_STRING_LENGTH_MIN; static final int BLUETOOTH_MAC_ADDRESS_STRING_LENGTH_MAX; static final String SIMPLE_HANDSHAKE_MESSAGE_AS_STRING; static final byte[] SIMPLE_HANDSHAKE_MESSAGE_AS_BYTE_ARRAY; }
@Test public void testIsBluetoothMacAddressUnknown() throws Exception { assertThat("The BT MAC address is unknown if null is provided", BluetoothUtils.isBluetoothMacAddressUnknown(null), is(true)); assertThat("The Bt MAC address is unknown if MARSHMALLOW_FAKE_MAC_ADDRESS provided", BluetoothUtils.isBluetoothMacAddressUnknown("02:00:00:00:00:00"), is(true)); assertThat("The Bt MAC address is unknown if BLUETOOTH_MAC_ADDRESS_UNKNOWN provided", BluetoothUtils.isBluetoothMacAddressUnknown( PeerProperties.BLUETOOTH_MAC_ADDRESS_UNKNOWN), is(true)); assertThat("The Bt MAC address is known if proper address provided", BluetoothUtils.isBluetoothMacAddressUnknown("01:02:03:04:05:06"), is(false)); }