docs: public static String appendParameters(String url, Map<String, String[]> params, boolean encode) {
  
          if (CmsStringUtil.isEmpty(url)) {
              return null;
          }
          if ((params == null) || params.isEmpty()) {
              return url;
          }
          int pos = url.indexOf(URL_DELIMITER);
          StringBuffer result = new StringBuffer(256);
          result.append(url);
          if (pos >= 0) {
              // url already has parameters
              result.append(PARAMETER_DELIMITER);
          } else {
              // url does not have parameters
              result.append(URL_DELIMITER);
          }
          // ensure all values are of type String[]
          Iterator<Map.Entry<String, String[]>> i = params.entrySet().iterator();
          while (i.hasNext()) {
              Map.Entry<String, String[]> entry = i.next();
              String key = entry.getKey();
              Object value = entry.getValue();
              // generics where added later, so make sure that the value really is a String[]
              String[] values = value instanceof String[] ? (String[])value : new String[] {value.toString()};
              for (int j = 0; j < values.length; j++) {
                  String strValue = values[j];
                  if (encode) {
                      strValue = CmsEncoder.encode(strValue);
                  }
                  result.append(key);
                  result.append(PARAMETER_ASSIGNMENT);
                  result.append(strValue);
                  if ((j + 1) < values.length) {
                      result.append(PARAMETER_DELIMITER);
                  }
              }
              if (i.hasNext()) {
                  result.append(PARAMETER_DELIMITER);
              }
          }
          return result.toString();
      }