HttpEntity takes generic type T as request body.
When T is MultiValueMap<String, Object>, and the values of the map contains non-string values such as Integer, an invoke to RestTemplate (with Content-Type "application/x-www-form-urlencoded") will cause ClassCastException.
I've attached a demo project that can re-produce this bug.
I've already submitted a pull request. Pull Request #2078