boolean (PsiExpression expression, int lowerBound, int upperBound) { final PsiType expressionType = expression.getType(); if (!PsiTypes.intType().equals(expressionType)) { return false; } final Object constant = ExpressionUtils.computeConstantExpression(expression); if (!(constant instanceof Integer)) { return false; } final int i = ((Integer)constant).intValue(); return i >= lowerBound && i <= upperBound; }