class ICUCompat {

    @Nullable
    public static String maximizeAndGetScript(Locale locale) {
        if (Build.VERSION.SDK_INT >= 21) {
            try {
                final Object[] args = new Object[] { locale };
                return ((Locale) sAddLikelySubtagsMethod.invoke(null, args)).getScript();
            } catch (InvocationTargetException e) {
                Log.w(TAG, e);
            } catch (IllegalAccessException e) {
                Log.w(TAG, e);
            }
            return locale.getScript();
        } else {
            final String localeWithSubtags = addLikelySubtags(locale);
            if (localeWithSubtags != null) {
                return getScript(localeWithSubtags);
            }

            return null;
        }
    }

    private  ICUCompat();

}