class Language {

    public boolean isCompatible(Language other) {
        if (other == null) {
            return false;
        }
        if ("*".equals(primaryTag)) {
            return true;
        }
        // primary tags match and sub-tag not specified (any matches)
        // if 'accept-language' is 'en' then 'en-us' and 'en-gb' is matches
        return primaryTag.equals(other.primaryTag)
               && (subTag.isEmpty() || subTag.equals(other.subTag));
    }

    public  Language(Locale locale);

}