getChanges(validate) {
          this.finishDeleteDeclarations();
          this.finishClassesWithNodesInsertedAtStart();
          const changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate);
          if (this.newFileChanges) {
            this.newFileChanges.forEach((insertions, fileName) => {
              changes.push(changesToText.newFileChanges(fileName, insertions, this.newLineCharacter, this.formatContext));
            });
          }
          return changes;
        }
Note: after calling this, the TextChanges object must be discarded!
@param validate only for tests
   The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions,
   so we can only call this once and can't get the non-formatted text separately.