Can you remove the duplicated toBuilder and build calls, e.g.,

```
request = request.toBuilder()
    .removeHeader(...)
    .replaceHeader(...)
    .build()
```