code: public void addStatement(AstNode statement) {
          assertNotNull(statement);
          if (statements == null) {
              statements = new ArrayList<AstNode>();
          }
          int end = statement.getPosition() + statement.getLength();
          this.setLength(end - this.getPosition());
          statements.add(statement);
          statement.setParent(this);
      }
docs: Adds a statement to the end of the statement list.
  Sets the parent of the new statement to this node, updates
  its start offset to be relative to this node, and sets the
  length of this node to include the new child.
  
  @param statement a child statement
  @throws IllegalArgumentException} if statement is {@code null}