class LocaleCodeSanitizer implements Sanitizer<String> {

    @Override
    public String execute(String content) {
        if (StringUtils.isBlank(content)) {
            return content;
        }
        Locale locale;
        try {
            locale = LocaleUtils.toLocale(content);
        } catch (Exception e) {
            return getDefaultLocale(content);
        }
        if (!Arrays.asList(Locale.getAvailableLocales()).contains(locale)) {
            return getDefaultLocale(content);
        }
        return locale.toString();
    }

}