@Override
  protected void processIntention(@NotNull PsiElement element, @NotNull Project project, Editor editor) throws IncorrectOperationException {
    final GrImportStatement context;
    final PsiMember resolved;
    if (element instanceof GrReferenceExpression ref) {
      GroovyResolveResult result = ref.advancedResolve();
      context = (GrImportStatement)result.getCurrentFileResolveContext();
      assert context != null;
      resolved = (PsiMember)result.getElement();
    }
    else if (element instanceof GrImportStatement) {
      context = (GrImportStatement)element;
      GrCodeReferenceElement reference = context.getImportReference();
      assert reference != null;
      resolved = (PsiMember)reference.resolve();
    }
    else {
      return;
    }

    assert resolved != null;
    doRefactoring(project, context, resolved);
  }
@Override
  protected void processIntention(@NotNull PsiElement element, @NotNull Project project, Editor editor)