/** * Returns the taxAmount for the passed in country or * null if no match is found. * * First checks the abbreviation (uppercase) followed by the name (uppercase). * * @param countryTaxRateMap, country * @return */ public Double lookupCountryRate(Map<String,Double> countryTaxRateMap, Country country) { if (countryTaxRateMap != null && country != null && country.getAbbreviation() != null) { String cntryAbbr = country.getAbbreviation().toUpperCase(); Double rate = countryTaxRateMap.get(cntryAbbr); if (rate == null && country.getName() != null) { String countryName = country.getName().toUpperCase(); return countryTaxRateMap.get(countryName); } else { return rate; } } return null; }