PeerAdvertisementFactory { public static UUID createProvideBluetoothMacAddressUuid(UUID serviceUuid, String requestId) { UUID provideBluetoothMacAddressUuid = null; if (serviceUuid != null && requestId != null) { String serviceUuidAsString = serviceUuid.toString(); String provideBluetoothMacAddressRequestUuidAsString = serviceUuidAsString.substring(0, serviceUuidAsString.length() - requestId.length()) + requestId; provideBluetoothMacAddressUuid = UUID.fromString(provideBluetoothMacAddressRequestUuidAsString); } return provideBluetoothMacAddressUuid; }  static AdvertiseData createAdvertiseDataToServiceData(
            UUID serviceUuid, int beaconAdExtraInformation, String bluetoothMacAddress); static AdvertiseData createAdvertiseDataToServiceData(
            UUID serviceUuid, int beaconAdExtraInformation, String bluetoothMacAddress,
            AdvertiseData.Builder builder); static AdvertiseData createAdvertiseDataToManufacturerData(
            int manufacturerId, int beaconAdLengthAndType, UUID serviceUuid,
            int beaconAdExtraInformation, String bluetoothMacAddress); static AdvertiseData createAdvertiseDataToManufacturerData(
            int manufacturerId, int beaconAdLengthAndType, UUID serviceUuid,
            int beaconAdExtraInformation, String bluetoothMacAddress,
            AdvertiseData.Builder builder, ByteArrayOutputStream byteArrayOutputStream,
            DataOutput dataOutputStream); static PeerProperties parsedAdvertisementToPeerProperties(
            BlePeerDiscoveryUtils.ParsedAdvertisement parsedAdvertisement); static PeerProperties manufacturerDataToPeerProperties(byte[] manufacturerData, UUID serviceUuid); static UUID createProvideBluetoothMacAddressUuid(UUID serviceUuid, String requestId); static UUID generateNewProvideBluetoothMacAddressRequestUuid(UUID serviceUuid); static String parseRequestIdFromUuid(UUID provideBluetoothMacAddressRequestUuid);  }
@Test public void testCreateProvideBluetoothMacAddressUuid_nullRequestIs() throws Exception { UUID serviceUuid = new UUID(1, 2); assertThat("The UUID is null when null requestId provided", PeerAdvertisementFactory.createProvideBluetoothMacAddressUuid(serviceUuid, null), is(nullValue())); }
@Test public void testCreateProvideBluetoothMacAddressUuid() throws Exception { UUID serviceUuid = new UUID(1, 2); String requestId = "10"; assertThat("The UUID is properly created", PeerAdvertisementFactory .createProvideBluetoothMacAddressUuid(serviceUuid, requestId), is(new UUID(1, 16))); }
@Test public void testCreateProvideBluetoothMacAddressUuid_nullServiceUuid() throws Exception { assertThat("The UUID is null when null serviceUuid provided", PeerAdvertisementFactory.createProvideBluetoothMacAddressUuid(null, "10"), is(nullValue())); }