@Override
    boolean isNecessaryCheck(PsiExpression condition, boolean negated) {
      if (condition instanceof PsiMethodCallExpression call) {
        List<? extends MethodContract> contracts = JavaMethodContractUtil.getMethodCallContracts(call);
        if (contracts.isEmpty()) return false;
        for (MethodContract contract : contracts) {
          if (!(contract.getReturnValue() instanceof BooleanReturnValue)) continue;
          boolean retValue = ((BooleanReturnValue)contract.getReturnValue()).getValue();
          List<ContractValue> conditions = contract.getConditions();
          if (conditions.size() != 1) continue;
          ContractValue cond = conditions.get(0);
          DfaCondition value = cond.fromCall(myFactory, call);
          if (value instanceof DfaRelation) {
            if (myConditions.contains(retValue == negated ? value : ((DfaRelation)value).negate())) {
              return true;
            }
          }
        }
        return false;
      }
      if (condition instanceof PsiBinaryExpression binOp) {
        RelationType relationType = DfaPsiUtil.getRelationByToken(binOp.getOperationTokenType());
        if (relationType != null) {
          PsiExpression left = binOp.getLOperand();
          PsiExpression right = binOp.getROperand();
          DfaValue leftVal = JavaDfaValueFactory.getExpressionDfaValue(myFactory, left);
          DfaValue rightVal = JavaDfaValueFactory.getExpressionDfaValue(myFactory, right);
          if (leftVal == null || rightVal == null) return false;
          DfaCondition value1 = leftVal.cond(relationType, rightVal);
          DfaCondition value2 = rightVal.cond(Objects.requireNonNull(relationType.getFlipped()), leftVal);
          if (value1 instanceof DfaRelation) {
            if (myConditions.contains(negated ? value1 : ((DfaRelation)value1).negate())) {
              return true;
            }
          }
          if (value2 instanceof DfaRelation) {
            if (myConditions.contains(negated ? value2 : ((DfaRelation)value2).negate())) {
              return true;
            }
          }
        }
      }
      return false;
    }
@Override
    boolean isNecessaryCheck(PsiExpression condition, boolean negated)