code: public List<String> encode(Collection<? extends Cookie> cookies) {
          if (checkNotNull(cookies, "cookies").isEmpty()) {
              return Collections.emptyList();
          }
  
          List<String> encoded = new ArrayList<String>(cookies.size());
          Map<String, Integer> nameToIndex = strict && cookies.size() > 1 ? new HashMap<String, Integer>() : null;
          int i = 0;
          boolean hasDupdName = false;
          for (Cookie c : cookies) {
              encoded.add(encode(c));
              if (nameToIndex != null) {
                  hasDupdName |= nameToIndex.put(c.name(), i++) != null;
              }
          }
          return hasDupdName ? dedup(encoded, nameToIndex) : encoded;
      }
docs: Batch encodes cookies into Set-Cookie header values.
  
  @param cookies a bunch of cookies
  @return the corresponding bunch of Set-Cookie headers