class PatternSpec {

    private static final int DEFAULT_PATTERN_SET_SIZE = 3;
    
    private LinkedHashSet<String> patternStrs;
    private LinkedHashSet<Pattern> patterns;

    
    
                   
    public PatternSpec() {
        super();
    }

    

    public boolean isEmpty() {
        return this.patterns == null || this.patterns.size() == 0;
    }

    
    public Set<String> getPatterns() {
        if (this.patternStrs == null) {
            return Collections.EMPTY_SET;
        }
        return Collections.unmodifiableSet(this.patternStrs);
    }


    public void setPatterns(final Set<String> newPatterns) {
        if (newPatterns != null) {
            if (this.patterns == null) {
                this.patternStrs = new LinkedHashSet<String>(DEFAULT_PATTERN_SET_SIZE);
                this.patterns = new LinkedHashSet<Pattern>(DEFAULT_PATTERN_SET_SIZE);
            } else {
                this.patternStrs.clear();
                this.patterns.clear();
            }
            this.patternStrs.addAll(newPatterns);
            for (final String pattern : newPatterns) {
                this.patterns.add(PatternUtils.strPatternToPattern(pattern));
            }
        } else if (this.patterns != null) {
            this.patternStrs.clear();
            this.patterns.clear();
        }
    }
    
    
    public void addPattern(final String pattern) {
        Validate.notEmpty(pattern, "Pattern cannot be null or empty");
        if (this.patterns == null) {
            this.patternStrs = new LinkedHashSet<String>(DEFAULT_PATTERN_SET_SIZE);
            this.patterns = new LinkedHashSet<Pattern>(DEFAULT_PATTERN_SET_SIZE);
        }
        this.patternStrs.add(pattern);
        this.patterns.add(PatternUtils.strPatternToPattern(pattern));
    }

    
    public void clearPatterns() {
        if (this.patterns != null) {
            this.patternStrs.clear();
            this.patterns.clear();
        }
    }
    
    
    
    
    public boolean matches(final String templateName) {<FILL_FUNCTION_BODY>}
    
    
    
    
    
    
}

        if (this.patterns == null) {
            return false;
        }
        for (final Pattern p : this.patterns) {
            if (p.matcher(templateName).matches()) {
                return true;
            }
        }
        return false;
    
<no_super_class>