@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    final PsiMethod method = getTargetMethod(editor, file);
    if (method != null) {
      boolean hasContract = JavaMethodContractUtil.findContractAnnotation(method) != null;
      setText(hasContract ? JavaBundle.message("intention.text.edit.method.contract.of.0", method.getName())
                          : JavaBundle.message("intention.text.add.method.contract.to.0", method.getName()));
      return true;
    }
    return false;
  }
@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file)