public static String abbreviateCenter(String str, int maxLength) {
        if (str == null) {
            return null;
        }
        final int length = str.length();
        if (length <= maxLength) {
            return str;
        }
        int headLength = maxLength / 2;
        int tailLength = maxLength - headLength - 1;
        String head = str.substring(0, headLength);
        String tail = str.substring(length - tailLength, length);
        return head + "\u2026" + tail;
    }
public static String abbreviateCenter ( String str , int maxLength ) { if ( str == null ) { return null ; } final int length = str . length ( ) ; if ( length <= maxLength ) { return str ; } int headLength = maxLength / 2 ; int tailLength = maxLength - headLength - 1 ; String head = str . substring ( 0 , headLength ) ; String tail = str . substring ( length - tailLength , length ) ; return head + "…" + tail ; }
Abbreviates the given string if it exceeds the given maximum length by replacing its center
part with an ellipsis ('&hellip;'). If the string is {@code null} or shorter than the limit,
it is returned as is.<p>

<pre>
Strings.abbreviateCenter(null,      3) == null
Strings.abbreviateCenter("",        3) == ""
Strings.abbreviateCenter(" ",       3) == " "
Strings.abbreviateCenter("a",       3) == "a"
Strings.abbreviateCenter("ab",      3) == "ab"
Strings.abbreviateCenter("abc",     3) == "abc"
Strings.abbreviateCenter("abcd",    3) == "a&hellip;d"
Strings.abbreviateCenter("abcde",   3) == "a&hellip;e"
Strings.abbreviateCenter("abcde",   4) == "ab&hellip;e"
Strings.abbreviateCenter("abcdef",  4) == "ab&hellip;f"
Strings.abbreviateCenter("abcdefg", 5) == "ab&hellip;fg"
</pre>

@param str the source string
@param maxLength the maximum length of the result string
@return {@code str} if its length is less than or equal to {@code maxLength}, an abbreviated
string with length {@code maxLength} where the center is replaced by an ellipsis