class Strings {

    public static String whiteSpacesToSingleSpace(String str) {
        if (str == null) return null;
        if (str.isEmpty()) return str;
        return MULTI_SPACE.matcher(WHITE_SPACE_EXCEPT_SPACE.matcher(str).replaceAll(" ")).replaceAll(" ");
    }

    private  Strings();

}