Transforming a Map to a query string is straight forward due to the natural name/value pair structure. This example will show various libraries can convert the map into a query string in java. Two things to be aware of, first is that the snippets don't focus on encoding the urls and second is that it is possible to have multiple query parameters with the same name. Since Maps naturally don't support duplicate values you may need to look for alternative if your use case requires it. A comparable examples shows how to transform a map to a query string using groovy.
Setup
Jersey
Jersey serves as a JAX-RS (JSR 311 & JSR 339) reference implementation and there isn't a nice method that accepts a Map. Due to this limitation we can iterate over a hashmap with a for loop passing the key and value into the builder.queryParam.
Converting the Map to a spring MultiValueMap which is an extension of a map that allows keys to be associated to multiple values. Passing the instance created to UriComponentsBuilder.queryParams will allow us to build a new query string from a map.
Apache Commons
Converting our Map of query string parameters to NameValuePair, which is similar in a sense to the spring snippet above, will allow us to pass it into the URIBuilder.setParameters.