@Override
    public RegisteredService save(final RegisteredService registeredService) {
        var savedService = (RegisteredService) null;
        for (val serviceRegistry : serviceRegistries) {
            var toSave = Optional.ofNullable(savedService).orElse(registeredService);
            savedService = serviceRegistry.save(toSave);
        }
        return savedService;
    }
This is {@link DefaultChainingServiceRegistry}.

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