@Override
    public Stream<RegisteredService> findServiceBy(final RegisteredServiceQuery... queries) {
        if (isEnabled()) {
            val serviceQueries = Arrays
                .stream(queries)
                .map(RegisteredServiceQueryAttribute::new)
                .map(RegisteredServiceQueryAttribute::toQuery)
                .toList();

            if (serviceQueries.isEmpty()) {
                LOGGER.trace("No queries were provided to search for services");
                return Stream.empty();
            }

            if (serviceQueries.size() == 1) {
                try (val results = indexedRegisteredServices.retrieve(serviceQueries.getFirst())) {
                    return results.stream();
                }
            }
            val subQueries = serviceQueries.subList(2, serviceQueries.size());
            val query = QueryFactory.and(serviceQueries.getFirst(), serviceQueries.get(1), (Collection) subQueries);
            try (val results = indexedRegisteredServices.retrieve(query)) {
                return results.stream();
            }
        }
        return Stream.empty();
    }
This is {@link DefaultRegisteredServiceIndexService}.

@author Misagh Moayyed
@since 7.3.0
core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/query/DefaultRegisteredServiceIndexService.java