public static void installCustomTabsService(String providerPackage, List<String> categories) {
        Intent intent = new Intent()
                .setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION)
                .setPackage(providerPackage);

        IntentFilter filter = new IntentFilter();
        for (String category : categories) {
            filter.addCategory(category);
        }
        ResolveInfo resolveInfo = new ResolveInfo();
        resolveInfo.filter = filter;

        ShadowPackageManager manager = Shadows.shadowOf(RuntimeEnvironment.application
                .getPackageManager());
        manager.addResolveInfoForIntent(intent, resolveInfo);
    }
Ensures intents with {@link CustomTabsService#ACTION_CUSTOM_TABS_CONNECTION} resolve to a
Service with given categories
customtabs/junit/src/android/support/customtabs/trusted/RobolectricUtils.java