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);
}

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 ) ; }
create a locale from language , with optional country and variant . then return the appropriate collator for the locale .
