@Override
    public RegisteredService locate(final Collection<? extends RegisteredService> candidates, final Service service) {
        return candidates
            .stream()
            .filter(registeredService -> supports(registeredService, service))
            .filter(registeredService -> registeredServiceFilter.test(registeredService, service))
            .findFirst()
            .orElse(null);
    }
This is {@link BaseServicesManagerRegisteredServiceLocator}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/BaseServicesManagerRegisteredServiceLocator.java