@Test
    public void trustedWebActivityProvider() {
        installBrowser(BROWSER1);
        installCustomTabsProvider(CUSTOM_TABS_PROVIDER1);
        installTrustedWebActivityProvider(TWA_PROVIDER1);
        installTrustedWebActivityProvider(TWA_PROVIDER2);

        TwaProviderPicker.Action action = TwaProviderPicker.pickProvider(mPackageManager);

        assertEquals(LaunchMode.TRUSTED_WEB_ACTIVITY, action.launchMode);
        assertEquals(TWA_PROVIDER1, action.provider);
    }
Tests that a Trusted Web Activity provider takes preference over all.
customtabs/junit/src/android/support/customtabs/trusted/TwaProviderPickerTest.java