CharSequence (@NotNull Set<String> allWords) { StringBuilder result = new StringBuilder(50); for (String string : allWords) { ProgressManager.checkCanceled(); if (!string.isEmpty()) { if (result.length() > 50) { result.append("..."); break; } if (result.length() != 0) result.append(", "); result.append(string); } } return result; }