docs: public static String cap(String str, int capSize) {
        if (str.length() <= capSize) {
           return str;
        }
        if (capSize <= 3) {
           return str.substring(0, capSize);
        }
        return str.substring(0, capSize - 3) + "...";
     }