private static String collectFragmentFor(final String id, final String fragment) {
        return FunctionUtils.doUnchecked(() -> new URIBuilder(id)
            .setFragment(fragment)
            .build()
            .toURL()
            .toExternalForm());
    }
Abstract implementation of a WebApplicationService.

@author Scott Battaglia
@since 3.1
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/principal/AbstractWebApplicationService.java