public static boolean canUseNewImpl(@NotNull Project project, PsiFile file, PsiElement @NotNull [] elements){
    final ExtractMethodProcessor processor = getProcessor(project, elements, file, false);
    if (processor == null) return true;
    try {
      processor.prepare(null);
      processor.prepareVariablesAndName();
      processor.myMethodName = "extracted";
    }
    catch (PrepareFailedException e) {
      return true;
    }

    return processor.estimateDuplicatesCount() == 0 && !processor.myInputVariables.isFoldable();
  }
public static boolean canUseNewImpl(@NotNull Project project, PsiFile file, PsiElement @NotNull [] elements)