Humm.  This is what the original code was doing but it's good point. For `null` and `[]` this seems like it's the correct behavior but `new String` will fail. Just about all of the methods in this file suffer from this same issue so I'd argue that it's something that should be handled outside of this PR.