@Nonnull
    public static String abbreviate(String str, int max) {
        if (str == null) {
            return "";
        } else if (str.length() <= max) {
            return str;
        } else {
            return str.substring(0, max - 3) + "...";
        }
    }
@Nonnull
    public static String abbreviate(String str, int max) {
        if (str == null) {
            return "";
        } else if (str.length() <= max) {
            return str;
        } else {
            return str.substring(0, max - 3) + "...";
        }
    }
@ Nonnull public static String abbreviate ( String str , int max ) { if ( str == null ) { return "" ; } else if ( str . length ( ) <= max ) { return str ; } else { return str . substring ( 0 , max - 3 ) + "..." ; } }
Abbreviates a String using ellipses. This will turn "Now is the time for all good men" into "Now is the time for..."

@param str the String to abbreviate
@param max the max number of chars of the abbreviated String
@return the abbreviated string
Abbreviates a String using ellipses . This will turn Now is the time for all good men into Now is the time for ...