Not necessarily ... keep in mind we're working with the key and not values. We only want to make sure this does not happen to the 'name' property.

This Map is the raw payload where everything is actually always a String. It's pulled in from the request. This code converts the values (Strings) into other kinds of objects if they match some pattern. So 'k' should always be a String especially since we're just dealing with keys here. If anything could be a non-String it would not be the key but the value. 

I am just being defensive just in case because of the generics type of Object put on the Map. I could have just used a cast directly to be able to check if the key = 'name'. Thought I'd be safer than sorry.