static List<DependencyLink> link(Map<Pair, Long> callCounts,
    Map<Pair, Long> errorCounts) {
    List<DependencyLink> result = new ArrayList<>(callCounts.size());
    for (Map.Entry<Pair, Long> entry : callCounts.entrySet()) {
      Pair parentChild = entry.getKey();
      result.add(DependencyLink.newBuilder()
        .parent(parentChild.left)
        .child(parentChild.right)
        .callCount(entry.getValue())
        .errorCount(errorCounts.getOrDefault(parentChild, 0L))
        .build());
    }
    return result;
  }
links are merged by mapping to parent/child and summing corresponding links
zipkin/src/main/java/zipkin2/internal/DependencyLinker.java