public static boolean urlEquals(String string1, String string2) {
        Uri url1 = Uri.parse(string1);
        Uri url2 = Uri.parse(string2);
        if (url1 == null || url2 == null || url1.getHost() == null || url2.getHost() == null) {
            return string1.equals(string2); // Unable to parse url properly
        }
        if (!url1.getHost().toLowerCase(Locale.ROOT).equals(url2.getHost().toLowerCase(Locale.ROOT))) {
            return false;
        }
        List<String> pathSegments1 = normalizePathSegments(url1.getPathSegments());
        List<String> pathSegments2 = normalizePathSegments(url2.getPathSegments());
        if (!pathSegments1.equals(pathSegments2)) {
            return false;
        }
        if (TextUtils.isEmpty(url1.getQuery())) {
            return TextUtils.isEmpty(url2.getQuery());
        }
        return url1.getQuery().equals(url2.getQuery());
    }
@Test
    public void testUrlEqualsDifferent() {
        assertFalse(UrlChecker.urlEquals("https://www.example.com/test", "https://www.example2.com/test"));
        assertFalse(UrlChecker.urlEquals("https://www.example.com/test", "https://www.example.de/test"));
        assertFalse(UrlChecker.urlEquals("https://example.com/", "https://otherpodcast.example.com/"));
        assertFalse(UrlChecker.urlEquals("https://www.example.com/?id=42&a=b", "https://www.example.com/?id=43&a=b"));
        assertFalse(UrlChecker.urlEquals("https://example.com/podcast%25test", "https://example.com/podcast test"));
        assertFalse(UrlChecker.urlEquals("antennapod_local:abc", "https://example.com/"));
    }