boolean (PsiExpression expression, PsiExpression operand, ContractReturnValue value) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (value.equals(ContractReturnValue.returnNull()) && EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(operand, expression)) { return true; } if (expression instanceof PsiMethodCallExpression call) { PsiExpressionList argumentList = call.getArgumentList(); if (argumentList.isEmpty()) return false; List<? extends MethodContract> contracts = JavaMethodContractUtil.getMethodCallContracts(call); for (MethodContract contract : contracts) { if (contract.getReturnValue().equals(value)) { List<ContractValue> conditions = contract.getConditions(); if (conditions.size() == 1) { ContractValue condition = conditions.get(0); int argIndex = condition.getNullCheckedArgument(true).orElse(-1); if (argIndex >= 0) { PsiExpression[] args = argumentList.getExpressions(); if (argIndex < args.length) { PsiExpression arg = args[argIndex]; if (hasContract(arg, operand, ContractReturnValue.returnNull())) { return true; } } } } } } } return false; }