class DuplicateKeyMapValueValidator implements ServiceAttributeValidator {

    @Override
    public boolean validate(Set<String> values) {
        boolean valid = true; //blank or empty values set are valid
        if (!CollectionUtils.isEmpty(values)) {
            for (String val : values) {
                final String trimmed = val.trim();
                if (trimmed.length() > 0) {
                    Matcher matcher = pattern.matcher(trimmed);
                    valid = matcher.matches();
                }
            }
        }
        return valid;
    }

}