CharSequence (@NotNull CharSequence text, int length, boolean prependEllipsis) { if (text.length() <= length) { return text; } if (prependEllipsis) { return "..." + text.subSequence(text.length() - length, text.length()); } return text.subSequence(text.length() - length, text.length()); }