Predicate<String> (String pattern) { final String[] patterns = pattern.split("\\|\\|"); final List<Pattern> compilePatterns = new ArrayList<>(); for (String p : patterns) { final Pattern compilePattern = getCompilePattern(p); if (compilePattern != null) { compilePatterns.add(compilePattern); } } return qualifiedName -> { for (Pattern compilePattern : compilePatterns) { if (compilePattern.matcher(qualifiedName).matches()) { return true; } } return false; }; }