private  void functionalInterfaceSelected(PsiType type,
                                            Project project,
                                            Editor editor,
                                            MyExtractMethodProcessor processor,
                                            PsiElement[] elements) {
    if (!elements[0].isValid()) return;
    if (!CommonRefactoringUtil.checkReadOnlyStatus(project, elements[0])) return;
    MyExtractMethodProcessor physicalProcessor =
      new MyExtractMethodProcessor(project, editor, elements,
                                   null, IntroduceFunctionalVariableAction.getRefactoringName(), null, HelpID.INTRODUCE_VARIABLE);
    try {
      physicalProcessor.prepare();
    }
    catch (PrepareFailedException e) {
      showErrorMessage(project, editor);
    }

    physicalProcessor.copyParameters(processor);
    physicalProcessor.setMethodVisibility(PsiModifier.PUBLIC);
    CommandProcessor.getInstance().executeCommand(project, () -> {
      PsiMethodCallExpression expression = WriteAction.compute(() -> createReplacement(project, type, physicalProcessor));
      invokeImpl(project, expression.getMethodExpression().getQualifierExpression(), editor);
    }, IntroduceFunctionalVariableAction.getRefactoringName(), null);
  }
private  void functionalInterfaceSelected(PsiType type,
                                            Project project,
                                            Editor editor,
                                            MyExtractMethodProcessor processor,
                                            PsiElement[] elements)