question: private Collator createFromLocale ( String language , String country , String variant ) { Locale locale ; if ( language != null && country == null && variant != null ) throw new SolrException ( ErrorCode . SERVER_ERROR , "To specify variant, country is required" ) ; else if ( language != null && country != null && variant != null ) locale = new Locale ( language , country , variant ) ; else if ( language != null && country != null ) locale = new Locale ( language , country ) ; else locale = new Locale ( language ) ; return Collator . getInstance ( locale ) ; }
target:  Create a locale from language, with optional country and variant. Then return the appropriate collator for the locale.