@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    String qualifierText = StringUtil.getPackageName(myInterfaceName);
    JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);

    PsiClass outerClass = psiFacade.findClass(qualifierText, GlobalSearchScope.projectScope(project));
    if (outerClass != null) {
      createClassInOuter(qualifierText, outerClass);
      return;
    }

    PsiPackage psiPackage;
    do {
      psiPackage = psiFacade.findPackage(qualifierText);
      qualifierText = StringUtil.getPackageName(qualifierText);
    }
    while (psiPackage == null && !StringUtil.isEmpty(qualifierText));

    if (psiPackage != null) {
      Map<Module, PsiDirectory[]> psiRootDirs = getModuleRootDirs(psiPackage);
      if (!psiRootDirs.isEmpty()) {
        if (ApplicationManager.getApplication().isUnitTestMode()) {
          PsiDirectory rootDir = file.getUserData(SERVICE_ROOT_DIR);
          CreateClassKind classKind = file.getUserData(SERVICE_CLASS_KIND);
          if (rootDir != null && classKind != null) {
            WriteAction.run(() -> createClassInRoot(myInterfaceName, classKind, rootDir, file, null));
          }
          return;
        }
        CreateServiceInterfaceDialog dialog = new CreateServiceInterfaceDialog(project, psiRootDirs);
        if (dialog.showAndGet()) {
          PsiDirectory rootDir = dialog.getRootDir();
          if (rootDir != null) {
            CreateClassKind classKind = dialog.getClassKind();
            PsiClass psiClass = WriteAction.compute(() -> createClassInRoot(myInterfaceName, classKind, rootDir, file, null));
            positionCursor(psiClass);
          }
        }
      }
    }
  }
@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file)