docs: function(branch, child) {
    // Validate.
    if (!isBranch(branch)) {
      assert(false);
    }
    if (!isBranchOrTask(child)) {
      assert(false);
    }
  
    // Branch already contains a child with the same name.
    if (branchContainsChild(branch, child)) {
      assert(false);
    }
  
    // Add child and then sort children.
    branch.children.push(child);
    branch.children.sort(compareBranchOrTask);
  }