code: public void insertChildAt(int index, Node<T> child) throws IndexOutOfBoundsException {
          if (index == getNumberOfChildren()) {
              // this is really an append
              addChild(child);
              return;
          } else {
              children.get(index); //just to throw the exception, and stop here
              children.add(index, child);
          }
      }
docs: Inserts a Node<T> at the specified position in the child list. Will     * throw an ArrayIndexOutOfBoundsException if the index does not exist.
  @param index the position to insert at.
  @param child the Node<T> object to insert.
  @throws IndexOutOfBoundsException if thrown.