String (Collection<String> names) { return StreamEx.of(names).map(name -> name.startsWith("'") || name.startsWith("\"") ? name : "'" + name + "'").mapLast("and "::concat) .collect(Joining.with(", ").maxChars(50).cutAfterDelimiter()); }