code: public static String addParameters(ExternalContext externalContext, String url,
                                         boolean addRequestParameter, boolean addPageParameter, boolean encodeValues)
      {
          StringBuilder finalUrl = new StringBuilder(url);
          boolean existingParameters = url.contains("?");
          boolean urlContainsWindowId = url.contains(ResponseStateManager.CLIENT_WINDOW_URL_PARAM + "=");
  
          /* TODO: implement me
          for(RequestParameter requestParam :
                  getParameters(externalContext, true, addRequestParameter, addPageParameter))
          {
              String key = requestParam.getKey();
  
              //TODO eval if we should also filter the other params
              if(WindowContextManager.WINDOW_CONTEXT_ID_PARAMETER_KEY.equals(key) && urlContainsWindowId)
              {
                  continue;
              }
  
              for(String parameterValue : requestParam.getValues())
              {
                  if(!url.contains(key + "=" + parameterValue) &&
                          !url.contains(key + "=" + encodeURLParameterValue(parameterValue, externalContext)))
                  {
                      if(!existingParameters)
                      {
                          finalUrl.append("?");
                          existingParameters = true;
                      }
                      else
                      {
                          finalUrl.append("&");
                      }
                      finalUrl.append(key);
                      finalUrl.append("=");
  
                      if(encodeValues)
                      {
                          finalUrl.append(encodeURLParameterValue(parameterValue, externalContext));
                      }
                      else
                      {
                          finalUrl.append(parameterValue);
                      }
                  }
              }
          }
          */
          return finalUrl.toString();
      }
docs: Adds the current request-parameters to the given url
  @param externalContext current external-context
  @param url current url
  @param addRequestParameter flag which indicates if the request params should be added or not
  @param addPageParameter flag which indicates if the view params should be added or not {@see ViewParameter}
  @param encodeValues flag which indicates if parameter values should be encoded or not
  @return url with request-parameters