private void add(String text,Text textNode){
  int startIndex=builder.length();
  builder.append(text);
  int endIndex=builder.length();
  textRuns.add(new TextRun(textNode,startIndex,endIndex));
}

private void add ( String text , Text textNode ) { int startIndex = builder . length ( ) ; builder . append ( text ) ; int endIndex = builder . length ( ) ; textRuns . add ( new TextRun ( textNode , startIndex , endIndex ) ) ; }
here we add a textnode and its postion to a list . we also build the paragraph string .
