class CountryServiceImpl extends SalesManagerEntityServiceImpl<Integer, Country>
		implements CountryService {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(CountryServiceImpl.class);
	
	private CountryRepository countryRepository;
	
	@Inject
	private CacheUtils cache;

	
	@Inject
	public CountryServiceImpl(CountryRepository countryRepository) {
		super(countryRepository);
		this.countryRepository = countryRepository;
	}
	
	@Cacheable("countrByCode")
	public Country getByCode(String code) throws ServiceException {
		return countryRepository.findByIsoCode(code);
	}

	@Override
	public void addCountryDescription(Country country, CountryDescription description) throws ServiceException {
		country.getDescriptions().add(description);
		description.setCountry(country);
		update(country);
	}
	
	@Override
	@Cacheable("countriesMap")
	public Map<String,Country> getCountriesMap(Language language) throws ServiceException {
		
		List<Country> countries = getCountries(language);
		
		Map<String,Country> returnMap = new LinkedHashMap<String,Country>();
		
		for(Country country : countries) {
			returnMap.put(country.getIsoCode(), country);
		}
		
		return returnMap;
	}
	
	
	@Override
	public List<Country> getCountries(final List<String> isoCodes, final Language language) throws ServiceException {
		List<Country> countryList = getCountries(language);
		List<Country> requestedCountryList = new ArrayList<Country>();
		if(!CollectionUtils.isEmpty(countryList)) {
			for(Country c : countryList) {
				if(isoCodes.contains(c.getIsoCode())) {
					requestedCountryList.add(c);
				}
			}
		}
		return requestedCountryList;
	}
	
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Country> getCountries(Language language) throws ServiceException {<FILL_FUNCTION_BODY>}

	@Override
	public List<Country> listCountryZones(Language language) throws ServiceException {
		try {
			return countryRepository.listCountryZonesByLanguage(language.getId());
		} catch(Exception e) {
			LOGGER.error("listCountryZones", e);
			throw new ServiceException(e);
		}

	}


}

		
		List<Country> countries = null;
		try {

			countries = (List<Country>) cache.getFromCache("COUNTRIES_" + language.getCode());
			if(countries==null) {
			
				countries = countryRepository.listByLanguage(language.getId());
			
				//set names
				for(Country country : countries) {
					
					CountryDescription description = country.getDescriptions().iterator().next();
					country.setName(description.getName());
					
				}
				
				cache.putInCache(countries, "COUNTRIES_" + language.getCode());
			}

		} catch (Exception e) {
			LOGGER.error("getCountries()", e);
		}
		
		return countries;
		
		
	
<methods>public void <init>(JpaRepository<com.salesmanager.core.model.reference.country.Country,java.lang.Integer>) ,public java.lang.Long count() ,public void create(com.salesmanager.core.model.reference.country.Country) throws com.salesmanager.core.business.exception.ServiceException,public void delete(com.salesmanager.core.model.reference.country.Country) throws com.salesmanager.core.business.exception.ServiceException,public void flush() ,public com.salesmanager.core.model.reference.country.Country getById(java.lang.Integer) ,public List<com.salesmanager.core.model.reference.country.Country> list() ,public void save(com.salesmanager.core.model.reference.country.Country) throws com.salesmanager.core.business.exception.ServiceException,public void saveAll(Iterable<com.salesmanager.core.model.reference.country.Country>) throws com.salesmanager.core.business.exception.ServiceException,public void update(com.salesmanager.core.model.reference.country.Country) throws com.salesmanager.core.business.exception.ServiceException<variables>private Class<com.salesmanager.core.model.reference.country.Country> objectClass,private JpaRepository<com.salesmanager.core.model.reference.country.Country,java.lang.Integer> repository