private static @NotNull CharSequence limitCharSequence(@NotNull CharSequence sequence, int limit) {
    return limit == UNLIMITED ? sequence : sequence.subSequence(0, Math.min(limit, sequence.length()));
  }
private static @NotNull CharSequence limitCharSequence(@NotNull CharSequence sequence, int limit)