If you have multiple uses for asserting that something is a string, you can do something like this. You can even do it if you have just one, and want to throw a specific error message. In the later case you cannot give it a generic name though. assertEntityIdIsString would be better