code: private void addRun(R run, int index) {
          int startIndex = currentPosition;
          int endIndex = currentPosition + RunUtil.getText(run).length() - 1;
          runs.add(new IndexedRun(startIndex, endIndex, index, run));
          currentPosition = endIndex + 1;
      }
docs: Adds a run to the aggregation.
  
  @param run the run to add.