@Override
    public Collection<RegisteredService> getAllServicesOfType(final Class clazz) {
        if (supports(clazz)) {
            return getCacheableServicesStream()
                .get()
                .filter(service -> clazz.isAssignableFrom(service.getClass()))
                .filter(this::validateAndFilterServiceByEnvironment)
                .filter(getRegisteredServicesFilteringPredicate())
                .sorted()
                .peek(RegisteredService::initialize)
                .peek(this::cacheRegisteredService)
                .collect(Collectors.toList());
        }
        return new ArrayList<>();
    }
This is {@link AbstractServicesManager}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/mgmt/AbstractServicesManager.java