I'd consider extracting `slash` and `symbol` into methods, firstly I think it allows the `ensureTrailingSlash` and `urlWithQueryString` to read better, it means they can be tested separately and potentially reused.

```
static String ensureTrailingSlash(url) {

    if (!url) return "/"

    return "${url}${slash}"
}

static String urlWithQueryString(url, queryString) {
   return "${url}${symbol(url)}${queryString}"
}

static String symbol(url) {
    return url.contains("?") ? "&" : "?"
}
    
static String slash(url) {
    return url.endsWith("/") ? "" : "/"
}
```