void (@NotNull PsiNewExpression expression) { super.visitNewExpression(expression); final PsiType type = expression.getType(); if (type == null || !type.equalsToText(CommonClassNames.JAVA_LANG_BOOLEAN)) { return; } final PsiClass aClass = ClassUtils.getContainingClass(expression); if (aClass != null) { final String qualifiedName = aClass.getQualifiedName(); if (CommonClassNames.JAVA_LANG_BOOLEAN.equals(qualifiedName)) { return; } } final PsiExpressionList argumentList = expression.getArgumentList(); if (argumentList == null) { return; } final PsiExpression[] expressions = argumentList.getExpressions(); if (expressions.length != 1) { return; } registerNewExpressionError(expression); }