boolean (PsiMethod method) { String name = method.getName(); if (name.startsWith("assert") || name.startsWith("check") || name.startsWith("require")) return true; PsiClass aClass = method.getContainingClass(); if (InheritanceUtil.isInheritor(aClass, "org.assertj.core.api.Descriptable")) { // See com.intellij.codeInsight.DefaultInferredAnnotationProvider#getHardcodedContractAnnotation return true; } return ContainerUtil.exists(JavaMethodContractUtil.getMethodCallContracts(method, null), mc -> !ContainerUtil.exists(mc.getConditions(), ContractValue::isBoundCheckingCondition) && mc.getReturnValue().isFail()); }