code: public static void setText(R run, String text) {
          run.getContent().clear();
          Text textObj = factory.createText();
          textObj.setSpace("preserve");
          textObj.setValue(text);
          textObj.setSpace("preserve"); // make the text preserve spaces
          run.getContent().add(textObj);
      }
docs: Sets the text of the given run to the given value.
  
  @param run  the run whose text to change.
  @param text the text to set.