### Question:
UriUtil { public static List<Bundle> toCustomTabUriBundle(Uri[] uris, int startIndex) { Preconditions.checkArgument(startIndex >= 0, "startIndex must be positive"); if (uris == null || uris.length <= startIndex) { return Collections.emptyList(); } List<Bundle> uriBundles = new ArrayList<>(uris.length - startIndex); for (int i = startIndex; i < uris.length; i++) { if (uris[i] == null) { Log.w(TAG, "Null URI in possibleUris list - ignoring"); continue; } Bundle uriBundle = new Bundle(); uriBundle.putParcelable(CustomTabsService.KEY_URL, uris[i]); uriBundles.add(uriBundle); } return uriBundles; } private  UriUtil(); static Uri parseUriIfAvailable(@Nullable String uri); static void appendQueryParameterIfNotNull(
            @NonNull Uri.Builder uriBuilder,
            @NonNull String paramName,
            @Nullable Object value); static Long getLongQueryParameter(@NonNull Uri uri, @NonNull String param); static List<Bundle> toCustomTabUriBundle(Uri[] uris, int startIndex); @NonNull static String formUrlEncode(@Nullable Map<String, String> parameters); @NonNull static String formUrlEncodeValue(@NonNull String value); static List<Pair<String, String>> formUrlDecode(String encoded); static Map<String, String> formUrlDecodeUnique(String encoded);  }### Answer:
@Test public void testToCustomTabUri() { Uri exampleUri = Uri.parse("https: Uri anotherExampleUri = Uri.parse("https: List<Bundle> bundles = UriUtil.toCustomTabUriBundle( new Uri[] { exampleUri, anotherExampleUri }, 0); assertThat(bundles).hasSize(2); assertThat(bundles.get(0).keySet()).contains(CustomTabsService.KEY_URL); assertThat(bundles.get(0).get(CustomTabsService.KEY_URL)).isEqualTo(exampleUri); assertThat(bundles.get(1).keySet()).contains(CustomTabsService.KEY_URL); assertThat(bundles.get(1).get(CustomTabsService.KEY_URL)).isEqualTo(anotherExampleUri); }
@Test public void testToCustomTabUri_startIndex() { Uri anotherExampleUri = Uri.parse("https: List<Bundle> bundles = UriUtil.toCustomTabUriBundle( new Uri[] { Uri.parse("https: anotherExampleUri }, 1); assertThat(bundles).hasSize(1); assertThat(bundles.get(0).keySet()).contains(CustomTabsService.KEY_URL); assertThat(bundles.get(0).get(CustomTabsService.KEY_URL)).isEqualTo(anotherExampleUri); }
@Test public void testToCustomTabUriBundle_emptyArray() { assertThat(UriUtil.toCustomTabUriBundle(new Uri[0], 0)).isEmpty(); }
@Test public void testToCustomTabUriBundle_nullArray() { assertThat(UriUtil.toCustomTabUriBundle(null, 0)).isEmpty(); }
@Test public void testToCustomTabUriBundle_startIndexOutsideArray() { List<Bundle> bundles = UriUtil.toCustomTabUriBundle( new Uri[] { Uri.parse("https: Uri.parse("https: }, 2); assertThat(bundles).hasSize(0); }