Updates StringUtils#trimAndCollapseWhitespaces to check isSpaceChar