public function appendStatement(StatementNode $statementNode) {
    if (!$this->isEmpty() && $this->firstToken()->getType() === '{') {
      $this->lastChild()->before($statementNode);
    }
    else {
      $this->appendChild($statementNode);
    }
    return $this;
  }