private static boolean joinTwoCalls(PsiMethodCallExpression firstCall,
                                      @NotNull PsiMethodCallExpression secondCall) {

    if (firstCall == null) return false;
    PsiExpression firstQualifier = getDeepQualifier(firstCall);
    if (firstQualifier == null) return false;
    PsiExpression secondQualifier = getDeepQualifier(secondCall);
    if (secondQualifier == null) return false;

    if (!PsiEquivalenceUtil.areElementsEquivalent(firstQualifier, secondQualifier)) return false;
    PsiType type = firstCall.getType();
    if (type == null || !firstCall.getType().equals(firstQualifier.getType())) return false;

    secondQualifier.replace(firstCall);
    firstCall.replace(secondCall);
    return true;
  }
private static boolean joinTwoCalls(PsiMethodCallExpression firstCall,
                                      @NotNull PsiMethodCallExpression secondCall)