boolean (PsiExpression expression) { if (!(expression instanceof PsiPolyadicExpression polyadicExpression)) { return false; } final IElementType sign = polyadicExpression.getOperationTokenType(); if (!s_booleanOperators.contains(sign)) { return false; } final PsiExpression[] operands = polyadicExpression.getOperands(); for (PsiExpression operand : operands) { if (!(operand instanceof PsiReferenceExpression) && !(operand instanceof PsiMethodCallExpression) && !(operand instanceof PsiLiteralExpression)) { return false; } } return true; }