code: public String signCookie(String str) {
      if (str == null || str.isEmpty()) {
        throw new IllegalArgumentException("NULL or empty string to sign");
      }
      String signature = getSignature(str);
  
      if (LOG.isDebugEnabled()) {
        LOG.debug("Signature generated for " + str + " is " + signature);
      }
      return str + SIGNATURE + signature;
    }
docs: Sign the cookie given the string token as input.
  @param str Input token
  @return Signed token that can be used to create a cookie