String (String filter, Set<? super String> quoted) { StringBuilder withoutQuoted = new StringBuilder(); int beg = 0; final Matcher matcher = QUOTED.matcher(filter); while (matcher.find()) { final int start = matcher.start(1); withoutQuoted.append(" ").append(filter, beg, start); beg = matcher.end(1); final String trimmed = filter.substring(start, beg).trim(); if (trimmed.length() > 0) { quoted.add(trimmed); } } return withoutQuoted + " " + filter.substring(beg); }