List<MethodContract> (PsiMethod method, int paramCount, String className, String methodName, @Nullable PsiMethodCallExpression call) { if (call != null && ("assertThat".equals(methodName) || "assumeThat".equals(methodName) || "that".equals(methodName))) { return handleAssertThat(paramCount, call); } if (!isJunit(className) && !isTestng(className)) { return Collections.emptyList(); } boolean testng = isTestng(className); if ("fail".equals(methodName)) { return Collections.singletonList(StandardMethodContract.trivialContract(paramCount, fail())); } if (paramCount == 0) return Collections.emptyList(); int checkedParam = testng || isJunit5(className) ? 0 : paramCount - 1; PsiType type = Objects.requireNonNull(method.getParameterList().getParameter(checkedParam)).getType(); ValueConstraint[] constraints = createConstraintArray(paramCount); if (("assertTrue".equals(methodName) || "assumeTrue".equals(methodName)) && PsiTypes.booleanType().equals(type)) { constraints[checkedParam] = FALSE_VALUE; return Collections.singletonList(new StandardMethodContract(constraints, fail())); } if (("assertFalse".equals(methodName) || "assumeFalse".equals(methodName)) && PsiTypes.booleanType().equals(type)) { constraints[checkedParam] = TRUE_VALUE; return Collections.singletonList(new StandardMethodContract(constraints, fail())); } if ("assertNull".equals(methodName) && TypeUtils.isJavaLangObject(type)) { constraints[checkedParam] = NOT_NULL_VALUE; return Collections.singletonList(new StandardMethodContract(constraints, fail())); } if ("assertNotNull".equals(methodName) && TypeUtils.isJavaLangObject(type)) { return failIfNull(checkedParam, paramCount, false); } return Collections.emptyList(); }