car/src/androidTest/java/androidx/car/navigation/utils/BundleMarshallerTest.java
private void assertBundlesEqual(Bundle expected, Bundle actual) {
        if (expected == null && actual == null) {
            return;
        }
        if (expected == null || actual == null) {
            fail(String.format("Expected %s value but found %s",
                    expected != null ? "non-null" : "null",
                    actual != null ? "non-null" : "null"));
        }
        if (!expected.keySet().equals(actual.keySet())) {
            fail(String.format("Expected keys: %s, but found keys: %s",
                    expected.keySet().stream().sorted().collect(Collectors.joining(",")),
                    actual.keySet().stream().sorted().collect(Collectors.joining(","))));
        }
        for (String key : expected.keySet()) {
            assertEquals(String.format("Expected '%s' at key '%s' but found '%s",
                            expected.get(key), key, actual.get(key)),
                    expected.get(key),
                    actual.get(key));
        }
    }
/**
     * Asserts that the provided {@link Bundle}s are equal. It throws {@link AssertionError}
     * otherwise.
     */
Asserts that the provided  Bundles are equal. It throws  AssertionError
otherwise.
Asserts that the provided Bundles are equal . It throws AssertionError otherwise .
private void assertBundlesEqual(Bundle expected, Bundle actual) {
        if (expected == null && actual == null) {
            return;
        }
        if (expected == null || actual == null) {
            fail(String.format("Expected %s value but found %s",
                    expected != null ? "non-null" : "null",
                    actual != null ? "non-null" : "null"));
        }
        if (!expected.keySet().equals(actual.keySet())) {
            fail(String.format("Expected keys: %s, but found keys: %s",
                    expected.keySet().stream().sorted().collect(Collectors.joining(",")),
                    actual.keySet().stream().sorted().collect(Collectors.joining(","))));
        }
        for (String key : expected.keySet()) {
            assertEquals(String.format("Expected '%s' at key '%s' but found '%s",
                            expected.get(key), key, actual.get(key)),
                    expected.get(key),
                    actual.get(key));
        }
    }
private void assertBundlesEqual ( Bundle expected , Bundle actual ) { if ( expected == null && actual == null ) { return ; } if ( expected == null || actual == null ) { fail ( String . format ( "Expected %s value but found %s" , expected != null ? "non-null" : "null" , actual != null ? "non-null" : "null" ) ) ; } if ( ! expected . keySet ( ) . equals ( actual . keySet ( ) ) ) { fail ( String . format ( "Expected keys: %s, but found keys: %s" , expected . keySet ( ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( "," ) ) , actual . keySet ( ) . stream ( ) . sorted ( ) . collect ( Collectors . joining ( "," ) ) ) ) ; } for ( String key : expected . keySet ( ) ) { assertEquals ( String . format ( "Expected '%s' at key '%s' but found '%s" , expected . get ( key ) , key , actual . get ( key ) ) , expected . get ( key ) , actual . get ( key ) ) ; } }
Asserts that the provided {@link Bundle}s are equal.
Asserts that the provided { @link Bundle } s are equal .