/** {@inheritDoc} */
  @SuppressWarnings("unchecked")
  @Override
  public List<LookupCode> appendCache(String cacheName, LookupCode lookupCode) {
    String lang = lookupCode.getLanguage();
    lookupCode.setLanguage("ALL");

    Cache cache = cacheManager.getCache("codeCache");
    Element element = cache.get(cacheName);
    Map<String, List<LookupCode>> map = (Map<String, List<LookupCode>>) element.getValue();
    List<LookupCode> lookupCodes = codeService.getCodeList(lookupCode);
    map.put(lookupCode.getCodeGroup(), lookupCodes);

    this.codeCache.put(new Element("codeList", map));
    lookupCode.setLanguage(lang);
    return lookupCodes;
  }
  /** {@inheritDoc} */
  @SuppressWarnings("unchecked")
  @Override
  public void removeCache(String cacheName, LookupCode lookupCode) {

    Cache cache = cacheManager.getCache("codeCache");
    Element element = cache.get("codeList");
    Map<String, List<LookupCode>> map = (Map<String, List<LookupCode>>) element.getValue();
    List<LookupCode> lookupCodes = codeService.getCodeList(lookupCode);
    if (lookupCodes.size() == 0) {
      map.remove(lookupCode.getCodeGroup());
    } else {
      map.put(lookupCode.getCodeGroup(), lookupCodes);
    }

    this.codeCache.put(new Element("codeList", map));
  }