title: How to add list items into a string url as query params?
body: <p>I have a table that contains some value and I am using a hash map to provide key value mapping:</p>
  <pre><code>|type|uri             |client |
  |----|----------------|-------|
  |    |https://test.com|test   |
  |aspx                 |test   |
  |aspx|https://test.com|       |
  </code></pre>
  <p>What I would like to do is build a url based on the values provided. So basically below what I do is check if any values are not empty, to add them in an array list like so.</p>
  <pre><code>private static final String CLIENT = &quot;client&quot;;
  private static final String URI = &quot;uri&quot;;
  private static final String TYPE = &quot;type&quot;;
  
  public void GetAuthorizeMissingRequiredFields(final Table table) {
  
      final String url = “/test/platform/auth”;
  
      final List&lt;TableRow&gt; rows = table.getTableRows();
      final Map&lt;String, String&gt; headers = getCurrentHeaders().getMap();
      ArrayList&lt;String&gt; queryParamsList = new ArrayList&lt;&gt;();
  
      rows.forEach(row -&gt; {
  
                  final String clientValue = row.getCell(&quot;client&quot;);
                  final String uriValue = row.getCell(&quot;uri&quot;);
                  final String typeValue = row.getCell(&quot;type&quot;);
  
                  if (!clientValue.isEmpty()) {
                      queryParamsList.add(CLIENT + clientValue);
                  }
  
                  if (!uriValue.isEmpty()) {
                      queryParamsList.add(URI + uriValue);
                  }
  
                  if (!typeValue.isEmpty()) {
                      queryParamsList.add(TYPE + typeValue);
                  }
  
              });
  
  }
  </code></pre>
  <p>Now here is my question. As you can see above I have a url string. What I want to do is add each item from the array list as a query para. So based on the table, the url should look like so:</p>
  <p>Scenario 1:</p>
  <pre><code>/test/platform/auth?uri=https://test.com&amp;client=test
  </code></pre>
  <p>Scenario 2:</p>
  <pre><code>/test/platform/auth?type=aspx&amp;client=test
  </code></pre>
  <p>Scenario 3:</p>
  <pre><code>/test/platform/auth?type=aspx&amp;uri=https://test.com
  </code></pre>
  <p>My question is how to do this append of the list items into a string as query params.</p>