class I18nKit {

    private static Map<String, ResourceHolder> CACHE = new ConcurrentHashMap<>();
    private static Pattern pattern = Pattern.compile("_");

    public static synchronized ResourceHolder getInstance(String baseName) {
        return createResourceHolder(baseName, null);
    }

    public static synchronized ResourceHolder getInstance(Locale locale) {
        return createResourceHolder(null, locale);
    }

    private static ResourceHolder createResourceHolder(String baseName, Locale locale) {
        Tuple2<String, Locale> localeModel = toLocaleModel(baseName, locale);
        ResourceHolder holder = CACHE.get(localeModel._1());
        if (null != holder) {
            return holder;
        }
        holder = new ResourceHolder(ResourceBundle.getBundle(localeModel._1(), localeModel._2()));
        CACHE.putIfAbsent(localeModel._1(), holder);
        return holder;
    }

    public static Tuple2<String, Locale> toLocaleModel(String baseName, Locale locale) {<FILL_FUNCTION_BODY>}

    public static class ResourceHolder {
        private ResourceBundle resourceBundle;

        public ResourceHolder(ResourceBundle resourceBundle) {
            this.resourceBundle = resourceBundle;
        }

        public String get(String key) {
            return resourceBundle.getString(key);
        }

        public Object getObject(String key) {
            return resourceBundle.getObject(key);
        }

        public boolean containsKey(String key) {
            return resourceBundle.containsKey(key);
        }

        public String format(String key, String... params) {
            return MessageFormat.format(resourceBundle.getString(key), params);
        }
    }
}

        if (StringKit.isBlank(baseName)) {
            if (StringKit.isEmpty(locale.getCountry())) {
                return new Tuple2<>("i18n_" + locale.getLanguage(), locale);
            }
            return new Tuple2<>("i18n_" + locale.getLanguage() + "_" + locale.getCountry(), locale);
        } else {
            String[] baseNames = pattern.split(baseName);
            if (baseNames != null && baseNames.length == 3) {
                return new Tuple2<>(baseName, new Locale(baseNames[1], baseNames[2]));
            }
            throw new IllegalArgumentException("baseName illegal,name format is :i18n_{language}_{country}.properties," +
                    "for example:i18n_zh_CN.properties");
        }
    
<no_super_class>