private void validateExistingProjectHasValidStateForImport(
      final BackupProject backupProject,
      final BackupSystemInformation backupSystemInformation,
      final Project existingProject,
      final I18nHelper i18n,
      final MessageSet messageSet) {
    final String projectKey = backupProject.getProject().getKey();

    // Verify that the project has no existing issues
    final long issueCount = issueManager.getIssueCountForProject(existingProject.getId());
    if (issueCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.issues",
              projectKey,
              String.valueOf(issueCount)));
    }

    // Verify that the project has no existing versions
    final long versionCount = versionManager.getVersions(existingProject.getId()).size();
    if (versionCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.versions",
              projectKey,
              String.valueOf(versionCount)));
    }

    // Verify that the project has no existing components
    final long componentCount =
        projectComponentManager.findAllForProject(existingProject.getId()).size();
    if (componentCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.components",
              projectKey,
              String.valueOf(componentCount)));
    }

    // Verify that if the project has a default assignee of Unassigned that the current instance of
    // JIRA supports unassigned issues
    if (projectHasDefaultAssigneeUnassigned(backupProject, backupSystemInformation)) {
      // We want this instance of JIRA to allow unassigned issues.
      final boolean allowUnassigned =
          applicationProperties.getOption(APKeys.JIRA_OPTION_ALLOWUNASSIGNED);
      if (!allowUnassigned) {
        messageSet.addErrorMessage(
            getText(
                i18n,
                "admin.error.project.import.project.default.assignee.not.allowed",
                backupProject.getProject().getName()));
      }
    }
  }