code: public static String getVariantKey(Map<String, String> curVariants, Set<String> variantTypes) {
  
  		String variantKey = "";
  		if (curVariants != null && variantTypes != null) {
  
  			Map<String, String> tempVariants = new TreeMap<>(curVariants);
  			StringBuilder variantKeyBuf = new StringBuilder();
  			for (Entry<String, String> entry : tempVariants.entrySet()) {
  				if (variantTypes.contains(entry.getKey())) {
  					String value = entry.getValue();
  					if (value == null) {
  						value = "";
  					}
  					variantKeyBuf.append(value + JawrConstant.VARIANT_SEPARATOR_CHAR);
  				}
  			}
  
  			variantKey = variantKeyBuf.toString();
  			if (StringUtils.isNotEmpty(variantKey)
  					&& variantKey.charAt(variantKey.length() - 1) == JawrConstant.VARIANT_SEPARATOR_CHAR) {
  				variantKey = variantKey.substring(0, variantKey.length() - 1);
  			}
  		}
  
  		return variantKey;
  	}
docs: Resolves a registered path from a locale key, using the same algorithm
  used to locate ResourceBundles.
  
  @param curVariants
  the current variant map
  @param variantTypes
  the list of variant types
  @return the variant key to use