par.replace(index, 1, new Element[]{ child1, child2 });
Element[] add = new Element[]{ child1, child2 }; par.replace(index, 1, add); documentEvent.addEdit(new ElementEdit(par, index, new Element[]{ el }, add));
    void split(Element el, int offset)    {      if (el instanceof AbstractElement)	{	  AbstractElement ael = (AbstractElement) el;	  int startOffset = ael.getStartOffset();	  int endOffset = ael.getEndOffset();	  int len = endOffset - startOffset;	  if (startOffset != offset && endOffset != offset)	    {	      Element paragraph = ael.getParentElement();	      if (paragraph instanceof BranchElement)		{		  BranchElement par = (BranchElement) paragraph;		  Element child1 = createLeafElement(par, ael, startOffset,						     offset);		  Element child2 = createLeafElement(par, ael, offset,						     endOffset);		  int index = par.getElementIndex(startOffset);		  par.replace(index, 1, new Element[]{ child1, child2 });		}              else                throw new AssertionError("paragraph elements are expected to "                                         + "be instances of "			  + "javax.swing.text.AbstractDocument.BranchElement");	    }	}      else	throw new AssertionError("content elements are expected to be "				 + "instances of "			+ "javax.swing.text.AbstractDocument.AbstractElement");    }