Element[] target = new Element[children.length - length + elements.length];
int delta = elements.length - length; int copyFrom = offset + length; int copyTo = copyFrom + delta; int numMove = numChildren - copyFrom; if (numChildren + delta > children.length) {  int newSize = Math.max(2 * children.length, numChildren + delta); Element[] target = new Element[newSize];
    public void replace(int offset, int length, Element[] elements)    {      Element[] target = new Element[children.length - length				     + elements.length];      System.arraycopy(children, 0, target, 0, offset);      System.arraycopy(elements, 0, target, offset, elements.length);      System.arraycopy(children, offset + length, target,		       offset + elements.length,		       children.length - offset - length);      children = target;    }