@Override
  public Collection<@DialogMessage String> findConflicts(@NotNull PsiElement element, PsiElement @NotNull [] elements, UsageInfo @NotNull [] usages) {
    String methodRefFound = null;
    if (element instanceof PsiMethod || element instanceof PsiParameter) {
      PsiMethod method;
      if (element instanceof PsiMethod) {
        method = (PsiMethod)element;
      }
      else {
        PsiElement declarationScope = ((PsiParameter)element).getDeclarationScope();
        method = declarationScope instanceof PsiMethod ? (PsiMethod)declarationScope : null;
      }
      if (method != null) {
        for (UsageInfo usage : usages) {
          PsiElement refElement = usage.getElement();
          if (refElement instanceof PsiMethodReferenceExpression && method.equals(((PsiMethodReferenceExpression)refElement).resolve())) {
            methodRefFound = JavaRefactoringBundle.message("expand.method.reference.warning");
            break;
          }
        }
      }
    }
    if (methodRefFound != null) {
      Collection<String> result = new ArrayList<>();
      result.add(methodRefFound);
      Collection<String> conflicts = super.findConflicts(element, elements, usages);
      if (conflicts != null) {
        result.addAll(conflicts);
      }
      return result;
    }
    return super.findConflicts(element, elements, usages);
  }
@Override
  public Collection<@DialogMessage String> findConflicts(@NotNull PsiElement element, PsiElement @NotNull [] elements, UsageInfo @NotNull [] usages)