I haven't checked in full detail, but would this work?
```
List... rules = ...
FirewallOptions firewallOptions = ... // without allowedRules
if (firewall == null) {
  firewallOptions.allowedRules(rules)
  ...
} else {
  rules.addAll(...)
  firewallOptions.allowedRules(rules)
  ...
}
```