I think this would be easier to reason about written as

``` java
final String path;
if (zNodes.entrySet().isEmpty()) {
  path = makeServedSegmentPath(...);
}
else {
  path = zNodes.entrySet().iterator.next();
}
```