private static boolean canShift(PsiExpression[] expressions, PsiCall callExpression, List<? super PsiCall> permutations, int i) {
    PsiCall copy = LambdaUtil.copyTopLevelCall(callExpression);
    if (copy == null) return false;
    PsiExpressionList list = copy.getArgumentList();
    if (list == null) return false;
    PsiExpression[] copyExpressions = list.getExpressions();
    for (int k = i; k < copyExpressions.length; k++) {
      copyExpressions[k].replace(expressions[k]);
    }

    JavaResolveResult result = copy.resolveMethodGenerics();
    if (result.getElement() != null && result.isValidResult()) {
      permutations.add(copy);
      if (permutations.size() > 1) return true;
    }
    return false;
  }
private static boolean canShift(PsiExpression[] expressions, PsiCall callExpression, List<? super PsiCall> permutations, int i)