### Question:
RunningSpeedAndCadenceFeatureDataCallback extends ProfileReadResponse implements RunningSpeedAndCadenceFeatureCallback { @Override public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) { super.onDataReceived(device, data); if (data.size() != 2) { onInvalidDataReceived(device, data); return; } final int value = data.getIntValue(Data.FORMAT_UINT16, 0); final RSCFeatures features = new RSCFeatures(value); onRunningSpeedAndCadenceFeaturesReceived(device, features); } RunningSpeedAndCadenceFeatureDataCallback(); protected  RunningSpeedAndCadenceFeatureDataCallback(final Parcel in); @Override void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data);  }### Answer:
@Test public void onRunningSpeedAndCadenceFeaturesReceived() { final ProfileReadResponse callback = new RunningSpeedAndCadenceFeatureDataCallback() { @Override public void onRunningSpeedAndCadenceFeaturesReceived(@NonNull final BluetoothDevice device, @NonNull final RSCFeatures features) { called = true; assertNotNull(features); assertTrue("Instantaneous Stride Length Measurement supported", features.instantaneousStrideLengthMeasurementSupported); assertFalse("Total Distance Measurement supported", features.totalDistanceMeasurementSupported); assertTrue("Walking Or Running Status supported", features.walkingOrRunningStatusSupported); assertTrue("Calibration Procedure supported", features.calibrationProcedureSupported); assertFalse("Multiple Sensor Locations supported", features.multipleSensorLocationsSupported); assertEquals("Feature value", 0b01101, features.value); } }; called = false; final Data data = new Data(new byte[] { 0b01101, 0x00 }); callback.onDataReceived(null, data); assertTrue(called); assertTrue(callback.isValid()); }
@Test public void onInvalidDataReceived() { final ProfileReadResponse callback = new RunningSpeedAndCadenceFeatureDataCallback() { @Override public void onRunningSpeedAndCadenceFeaturesReceived(@NonNull final BluetoothDevice device, @NonNull final RSCFeatures features) { called = true; } }; called = false; final Data data = new Data(new byte[] { 0b01101 }); callback.onDataReceived(null, data); assertFalse(called); assertFalse(callback.isValid()); }