negotiate function
The highest wire version present in both local and remote, or null
when the sets share none (the peers cannot talk).
Implementation
int? negotiate(List<int> local, List<int> remote) {
int? best;
for (final version in local) {
if (!remote.contains(version)) continue;
if (best == null || version > best) best = version;
}
return best;
}