@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    final PsiMethod method = getTargetMethod(editor, file);
    assert method != null;
    PsiAnnotation existingAnno = AnnotationUtil.findAnnotationInHierarchy(method, Collections.singleton(Contract.class.getName()));
    ContractData data = ContractData.fromAnnotation(existingAnno);
    OptPaneUtils.editOptions(project, data, data.getOptionPane(method), JavaBundle.message("dialog.title.edit.method.contract"),
                             "define_contract_dialog", () -> updateContract(method, data));
  }
@Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file)