static buildTree(dom, segment, elem, detailsRenderer) {
    elem.append(CRCRenderer.createChainNode(dom, segment, detailsRenderer));
    if (segment.node.children) {
      for (const key of Object.keys(segment.node.children)) {
        const childSegment = CRCRenderer.createSegment(segment.node.children, key,
          segment.treeMarkers, segment.isLastChild);
        CRCRenderer.buildTree(dom, childSegment, elem, detailsRenderer);
      }
    }
  }
Recursively builds a tree from segments.
@param {DOM} dom
@param {NetworkSegment} segment
@param {Element} elem Parent element.
@param {DetailsRenderer} detailsRenderer