protected boolean compareServices(final Service service, final Service serviceToMatch) throws Exception {
        val thisUrl = removeFragmentFrom(URLDecoder.decode(service.getId(), StandardCharsets.UTF_8));
        val serviceUrl = removeFragmentFrom(URLDecoder.decode(serviceToMatch.getId(), StandardCharsets.UTF_8));
        LOGGER.debug("Decoded urls and comparing [{}] with [{}]", thisUrl, serviceUrl);
        return thisUrl.equalsIgnoreCase(serviceUrl);
    }
This is {@link DefaultServiceMatchingStrategy}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/principal/DefaultServiceMatchingStrategy.java