We might as well go for the fastest known idiom everywhere:

```
  for (int i = 0, size = response.getHeaders().size(); i < size; i++) {
    ...
  }
```