You could also move this to our TypeUtils class. Though this isn't strictly a type util. In which case you're welcome to rename that class to `Util`.