T <: Message
The values of T must be of any type that extends Message.
Now the TTBOMK equality / isomorphism functionality is impossible. This means that there is no way to compare a == b, where a: T => T and b: T => T.
You can only generate random inputs and confirm that they give the same result. Not proof of equality, but it could be better than nothing.
If your result val t: T=>T = prepend(...), you can run tas t(some T).