### Question:
UrlUtils { public static boolean urlsMatchExceptForTrailingSlash(final @NonNull String url1, final @NonNull String url2) { int lengthDifference = url1.length() - url2.length(); if (lengthDifference == 0) { return url1.equalsIgnoreCase(url2); } else if (lengthDifference == 1) { return url1.charAt(url1.length() - 1) == '/' && url1.regionMatches(true, 0, url2, 0, url2.length()); } else if (lengthDifference == -1) { return url2.charAt(url2.length() - 1) == '/' && url2.regionMatches(true, 0, url1, 0, url1.length()); } return false; }  static String normalize(@NonNull String input); static boolean isUrl(String url); static boolean isValidSearchQueryUrl(String url); static boolean isHttpOrHttps(String url); static boolean isSearchQuery(String text); static String createSearchUrl(Context context, String searchTerm); static String stripUserInfo(@Nullable String url); static boolean isPermittedResourceProtocol(@Nullable final String scheme); static boolean isSupportedProtocol(@Nullable final String scheme); static boolean isInternalErrorURL(final String url); static boolean urlsMatchExceptForTrailingSlash(final @NonNull String url1, final @NonNull String url2); static String stripCommonSubdomains(@Nullable String host); static boolean isLocalizedContent(@Nullable String url);  }### Answer:
@Test public void urlsMatchExceptForTrailingSlash() throws Exception { assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("https: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertFalse(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: assertTrue(UrlUtils.urlsMatchExceptForTrailingSlash("http: }