class HttpHeadersImpl implements HttpHeaders {

    @Override
    public List<Locale> getAcceptableLanguages() {
        // Accept-Language: da
        // Accept-Language: en-gb;q=0.8
        List<String> values = nettyHttpHeaders.getAll(HttpHeaders.ACCEPT_LANGUAGE);
        if (values.isEmpty()) {
            return Collections.singletonList(new Locale("*"));
        }

        List<Locale> localeValues = new ArrayList<>();
        Map<Locale, Float> prefs = new HashMap<>();
        // derive preferences from Accept-Language and sort languages according to the preferences.
        for (String value : values) {
            String[] pair = value != null ? value.split(";") : new String[0];
            Locale locale = new Locale(pair[0].trim());
            localeValues.add(locale);
            if (pair.length > 1) {
                String[] pair2 = pair[1] != null ? pair[1].split("=") : new String[0];
                if (pair2.length > 1) {
                    prefs.put(locale, getLanguageQualityFactor(pair2[1].trim()));
                } else {
                    prefs.put(locale, 1F);
                }
            } else {
                prefs.put(locale, 1F);
            }
        }

        if (localeValues.size() <= 1) {
            return localeValues;
        }
        localeValues.sort(new AcceptLanguageComparator(prefs));
        return localeValues;
    }

    public  HttpHeadersImpl(io.netty.handler.codec.http.HttpHeaders httpHeaders);

}