On review, StringUtils has some suboptimal whitespace checks: For hasText(String), it can use the JDK 11+ String.isBlank() method, and in trimAllWhitespace(CharSequence), it unnecessarily returns StringBuilder.toString() instead of just the StringBuilder itself.

Comment From: jhoeller

While JDK 11's isBlank() can only be used in Spring Framework 6.0+, the other refinements can be backported to 5.3.x as well.