car/src/androidTest/java/androidx/car/navigation/utils/BundleMarshallerTest.java
@Test
    public void deltaSerialization_onlyContainsModifiedData() {
        // Serialize some base data
        TestBundlable testValue = new TestBundlable()
                .setInt(1)
                .setString("TEST")
                .setBundlableValue(new TestBundlable()
                        .setEnumValue(TestBundlable.TestEnum.VALUE1));
        testValue.toBundle(mBundleMarshaller);

        // Reset change tracking and re-serialize after making some changes.
        mBundleMarshaller.resetDelta();
        testValue.setInt(2).setString(null);
        testValue.mBundableValue.setEnumValue(TestBundlable.TestEnum.VALUE2);
        testValue.toBundle(mBundleMarshaller);

        Bundle expectedDelta = new Bundle();
        expectedDelta.putInt("intValue", testValue.mIntValue);
        expectedDelta.putString("stringValue", testValue.mStringValue);
        expectedDelta.putString("bundlableValue.enumValue",
                testValue.mBundableValue.mEnumValue.name());

        Bundle delta = mBundleMarshaller.getDelta();
        assertBundlesEqual(expectedDelta, delta);
    }
/**
     * Tests that {@link BundleMarshaller#getDelta()} returns only the data that has been modified
     * between two serializations.
     */
Tests that  BundleMarshaller#getDelta() returns only the data that has been modified
between two serializations.
Tests that BundleMarshaller#getDelta () returns only the data that has been modified between two serializations .
@Test
    public void deltaSerialization_onlyContainsModifiedData() {
        TestBundlable testValue = new TestBundlable()
                .setInt(1)
                .setString("TEST")
                .setBundlableValue(new TestBundlable()
                        .setEnumValue(TestBundlable.TestEnum.VALUE1));
        testValue.toBundle(mBundleMarshaller);
        mBundleMarshaller.resetDelta();
        testValue.setInt(2).setString(null);
        testValue.mBundableValue.setEnumValue(TestBundlable.TestEnum.VALUE2);
        testValue.toBundle(mBundleMarshaller);
        Bundle expectedDelta = new Bundle();
        expectedDelta.putInt("intValue", testValue.mIntValue);
        expectedDelta.putString("stringValue", testValue.mStringValue);
        expectedDelta.putString("bundlableValue.enumValue",
                testValue.mBundableValue.mEnumValue.name());
        Bundle delta = mBundleMarshaller.getDelta();
        assertBundlesEqual(expectedDelta, delta);
    }
@ Test public void deltaSerialization_onlyContainsModifiedData ( ) { TestBundlable testValue = new TestBundlable ( ) . setInt ( 1 ) . setString ( "TEST" ) . setBundlableValue ( new TestBundlable ( ) . setEnumValue ( TestBundlable . TestEnum . VALUE1 ) ) ; testValue . toBundle ( mBundleMarshaller ) ; mBundleMarshaller . resetDelta ( ) ; testValue . setInt ( 2 ) . setString ( null ) ; testValue . mBundableValue . setEnumValue ( TestBundlable . TestEnum . VALUE2 ) ; testValue . toBundle ( mBundleMarshaller ) ; Bundle expectedDelta = new Bundle ( ) ; expectedDelta . putInt ( "intValue" , testValue . mIntValue ) ; expectedDelta . putString ( "stringValue" , testValue . mStringValue ) ; expectedDelta . putString ( "bundlableValue.enumValue" , testValue . mBundableValue . mEnumValue . name ( ) ) ; Bundle delta = mBundleMarshaller . getDelta ( ) ; assertBundlesEqual ( expectedDelta , delta ) ; }
Tests that {@link BundleMarshaller#getDelta()} returns only the data that has been modified
 between two serializations.
Tests that { @link BundleMarshaller#getDelta () } returns only the data that has been modified between two serializations .
// Serialize some base data // Reset change tracking and re-serialize after making some changes.