code: public String getUrl(String email) {
          if (email == null) {
              throw new IllegalArgumentException("Email can't be null.");
          }
  
          String emailHash = DigestUtils.md5Hex(email.trim().toLowerCase());
  
          boolean firstParameter = true;
          // StringBuilder standard capacity is 16 characters while the minimum
          // url is 63 characters long. The maximum length without
          // customDefaultImage
          // is 91.
          StringBuilder builder = new StringBuilder(91)
                  .append(https ? HTTPS_URL : URL)
                  .append(emailHash)
                  .append(FILE_TYPE_EXTENSION);
  
          if (size != DEFAULT_SIZE) {
              addParameter(builder, "s", Integer.toString(size), firstParameter);
              firstParameter = false;
          }
          if (forceDefault) {
              addParameter(builder, "f", "y", firstParameter);
              firstParameter = false;
          }
          if (rating != DEFAULT_RATING) {
              addParameter(builder, "r", rating.getKey(), firstParameter);
              firstParameter = false;
          }
          if (customDefaultImage != null) {
              addParameter(builder, "d", customDefaultImage, firstParameter);
          } else if (standardDefaultImage != null) {
              addParameter(builder, "d", standardDefaultImage.getKey(), firstParameter);
          }
  
          return builder.toString();
      }
docs: Retrieve the gravatar URL for the given email.
  
  @param email The email for which the avatar URL should be returned.
  @return URL to the gravatar.