private static Optional<NameValuePair> getReplyAsParameter(final Service service) {
        return Optional.ofNullable(service)
            .map(Unchecked.function(svc -> {
                val builder = new URIBuilder(svc.getId());
                return builder.getQueryParams()
                    .stream()
                    .filter(p -> p.getName().equals(WSFederationConstants.WREPLY))
                    .findFirst()
                    .orElse(null);
            }));
    }
This is {@link WSFederationAuthenticationServiceSelectionStrategy}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/WSFederationAuthenticationServiceSelectionStrategy.java