Adding users programmatically in 5.7

Permalink
Hello,

I would like to know how to add users programmetically. I used to be able to do this with userinfo::add, but that is now deprecated. It should now be done using RegistrationService but I cant figure out how to.

Thanks in advance.