Spec<RelativePath> (boolean caseSensitive) { Collection<String> allExcludes = new LinkedHashSet<>(myFilePattern.excludes); List<Spec<RelativePath>> matchers = new ArrayList<>(); for (String exclude : allExcludes) { PatternMatcher matcher = PatternMatcherFactory.getPatternMatcher(false, caseSensitive, exclude); matchers.add(new MyRelativePathSpec(matcher)); } if (matchers.isEmpty()) { return Specs.satisfyNone(); } return Specs.union(matchers); }