In fact we can Elvis the url assignment so it can become

```
static String ensureTrailingSlash(url) {

    url = url ?: "/"

    return "${url}${slash(url)}"
}
```