static S shorten(S s, int max) { if (s == null) ret ""; if (max < 0) ret s; return s.length() <= max ? s : s.substring(0, Math.min(s.length(), max)) + "..."; } static S shorten(int max, S s) { ret shorten(s, max); }