code: @Override
      public String cacheKam(String kamName, Kam kam) {
  
          if (kam == null) {
              throw new InvalidArgument("kam", kam);
          }
  
          if (kamName == null) {
              kamName = kam.getKamInfo().getName();
              if (kamName == null) {
                  throw new InvalidArgument("no KAM name available");
              }
          }
  
          read.lock();
          try {
              for (Entry<String, Kam> entry : kamMap.entrySet()) {
                  final Kam value = entry.getValue();
                  if (kamName.equals(value.getKamInfo().getName())) {
                      return entry.getKey();
                  }
              }
          } finally {
              read.unlock();
          }
  
          // Generate a key and cache it
          String key = generateCacheKey();
          write.lock();
          try {
              while (kamMap.containsKey(key)) {
                  key = generateCacheKey();
              }
              kamMap.put(key, kam);
          } finally {
              write.unlock();
          }
          return key;
      }
docs: {@inheritDoc}