private static boolean equalResolveResult(JavaResolveResult r1, JavaResolveResult r2) {
    PsiElement target1 = r1.getElement();
    PsiElement target2 = r2.getElement();
    boolean targetMatch = target1 == null ? target2 == null : target1.getManager().areElementsEquivalent(target2, target1); 
    if (!targetMatch) return false;
    boolean applicable1 = !(r1 instanceof MethodCandidateInfo) || ((MethodCandidateInfo)r1).isApplicable();
    boolean applicable2 = !(r2 instanceof MethodCandidateInfo) || ((MethodCandidateInfo)r2).isApplicable();
    if (applicable1 != applicable2) return false;
    String message1 = r1 instanceof MethodCandidateInfo ? ((MethodCandidateInfo)r1).getInferenceErrorMessage() : null;
    String message2 = r2 instanceof MethodCandidateInfo ? ((MethodCandidateInfo)r2).getInferenceErrorMessage() : null;
    return Objects.equals(message1, message2);
  }
private static boolean equalResolveResult(JavaResolveResult r1, JavaResolveResult r2)