`getHostPortPair()` can return null. This will be bad for `pairs.add()`.  It is probably best to use a local and do a null check.