code: func (c *Container) runAppendInterval(v interval16) int32 {
  	runs := c.runs()
  	if len(runs) == 0 {
  		runs = append(runs, v)
  		c.setRuns(runs)
  		return int32(v.last-v.start) + 1
  	}
  
  	last := runs[len(runs)-1]
  	if last.last == maxContainerVal { //protect against overflow
  		return 0
  	}
  	if last.last+1 >= v.start && v.last > last.last {
  		runs[len(runs)-1].last = v.last
  		c.setRuns(runs)
  		return int32(v.last - last.last)
  	} else if last.last+1 < v.start {
  		runs = append(runs, v)
  		c.setRuns(runs)
  		return int32(v.last-v.start) + 1
  	}
  	return 0
  }
docs: // runAppendInterval adds the given interval to the run container. It assumes
  // that the interval comes at the end of the list of runs, and does not check
  // that this is the case. It will not behave correctly if the start of the given
  // interval is earlier than the start of the last interval in the list of runs.
  // Its return value is the amount by which the cardinality of the container was
  // increased.