public function generateRenamedModels()
    {
        $addedModels = array_diff($this->newModelKeys, $this->oldModelKeys);

        /* @var $modelState ModelState */
        foreach ($addedModels as $addedModel) {
            $modelState = $this->toState->getModelState($addedModel);
            $meta = $this->newRegistry->getModel($addedModel)->getMeta();
            $modelDefinitionList = $this->getFieldsDefinitions(
                $modelState->fields
            );

            $removedModels = array_diff(
                $this->oldModelKeys,
                $this->newModelKeys
            );
            foreach ($removedModels as $removedModel) {
                $remModelState = $this->fromState->getModelState($removedModel);
                $remModelDefinitionList = $this->getFieldsDefinitions(
                    $remModelState->fields
                );

                if ($remModelDefinitionList == $modelDefinitionList) {
                    if (MigrationQuestion::hasModelRenamed(
                        $this->asker,
                        $removedModel,
                        $addedModel
                    )) {
                        $this->addOperation(
                            $meta->getAppName(),
                            RenameModel::createObject(
                                [
                                    'oldName' => $removedModel,
                                    'newName' => $addedModel,
                                ]
                            )
                        );

                        $this->renamedModels[$addedModel] = $removedModel;

                        // remove the old name and update with the new name.
                        $pos = array_search($removedModel, $this->oldModelKeys);

                        array_splice(
                            $this->oldModelKeys,
                            $pos,
                            1,
                            [$addedModel]
                        );

                        // you can stop here.
                        break;
                    }
                }
            }
        }
    }