String (final Collection<String> masks) { final StringBuilder patterns = new StringBuilder(); for (String mask : masks) { if (patterns.length() != 0) { patterns.append('|'); } patterns.append(PatternUtil.convertToRegex(mask)); } return patterns.toString(); }