boolean (@NotNull InstanceofChecker checker, @Nullable PsiMethodCallExpression call) { if (call == null) return false; List<? extends MethodContract> contracts = JavaMethodContractUtil.getMethodCallContracts(call); if (contracts.isEmpty()) return false; MethodContract contract = contracts.get(0); if (!contract.getReturnValue().isFail()) return false; ContractValue condition = ContainerUtil.getOnlyItem(contract.getConditions()); if (condition == null) return false; checker.negate = true; OptionalInt argNum = condition.getArgumentComparedTo(ContractValue.booleanValue(true), true); if (argNum.isEmpty()) { checker.negate = false; argNum = condition.getArgumentComparedTo(ContractValue.booleanValue(false), true); } if (argNum.isEmpty()) return false; int index = argNum.getAsInt(); PsiExpression[] args = call.getArgumentList().getExpressions(); if (index >= args.length) return false; checker.checkExpression(args[index]); return checker.hasAgreeingInstanceof(); }