@Test
    void verifySavingServices() {
        getRegisteredServiceTypes().forEach(type -> {
            val registeredService = buildRegisteredServiceInstance(100, type)
                .setId(RegisteredServiceDefinition.INITIAL_IDENTIFIER_VALUE);
            val savedService = serviceRegistry.save(registeredService);
            val services = serviceRegistry.load();
            assertTrue(services.stream().anyMatch(svc -> svc.equals(savedService)));
            val registeredService2 = buildRegisteredServiceInstance(101, type)
                .setId(RegisteredServiceDefinition.INITIAL_IDENTIFIER_VALUE);
            val savedService2 = serviceRegistry.save(registeredService2);
            val services2 = serviceRegistry.load();
            assertTrue(services2.stream().anyMatch(svc -> svc.equals(savedService2)));
        });
    }
Abstracted service registry tests for all implementations.

@author Timur Duehr
@since 5.3.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/AbstractServiceRegistryTests.java