@CanIgnoreReturnValue
    default RegisteredService assignIdIfNecessary() {
        if (getId() == RegisteredServiceDefinition.INITIAL_IDENTIFIER_VALUE) {
            setId(System.nanoTime());
        }
        return this;
    }
Assign id if undefined.

@return the registered service
api/cas-server-core-api-services/src/main/java/org/apereo/cas/services/RegisteredService.java