If you have shapeless in your dependencies you could consider my little helper method: https://gist.github.com/Fristi/bbc9d0e04557278f8d19976188a0b733
Instead of writing
UserId(is(context.userId.value))
You can write
isAnyVal(context.userId)
Which is a bit more convenient :-)