### Question:
BodySensorLocationDataCallback extends ProfileReadResponse implements BodySensorLocationCallback { @Override public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) { super.onDataReceived(device, data); if (data.size() < 1) { onInvalidDataReceived(device, data); return; } final int sensorLocation = data.getIntValue(Data.FORMAT_UINT8, 0); onBodySensorLocationReceived(device, sensorLocation); } BodySensorLocationDataCallback(); protected  BodySensorLocationDataCallback(final Parcel in); @Override void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data);  }### Answer:
@Test public void onBodySensorLocationReceived() { success = false; final Data data = new Data(new byte[] { BodySensorLocationCallback.SENSOR_LOCATION_EAR_LOBE }); response.onDataReceived(null, data); assertTrue(response.isValid()); assertTrue(success); assertEquals(BodySensorLocationCallback.SENSOR_LOCATION_EAR_LOBE, sensorLocation); }
@Test public void onInvalidDataReceived() { success = false; final Data data = new Data(); response.onDataReceived(null, data); assertFalse(response.isValid()); assertFalse(success); }