Collection<String> (@NotNull String initial, @NotNull Collection<String> suggestions) { if (!StringUtil.isQuotedString(initial)) { return suggestions; } char quote = initial.charAt(0); StringBuilder tmp = new StringBuilder(); ArrayList<String> result = new ArrayList<>(suggestions.size()); for (String suggestion : suggestions) { tmp.append(suggestion); StringUtil.quote(tmp, quote); result.add(tmp.toString()); tmp.setLength(0); } return result; }