boolean (PsiVariable variable) { if (variable instanceof PsiField && variable.hasModifierProperty(PsiModifier.FINAL) && variable.getType().equals(PsiTypes.booleanType())) { // Skip boolean constant fields as they usually used as control knobs to modify program logic // it's better to analyze both true and false values even if it's predefined PsiLiteralExpression initializer = tryCast(PsiUtil.skipParenthesizedExprDown(variable.getInitializer()), PsiLiteralExpression.class); return initializer != null && initializer.getValue() instanceof Boolean; } return false; }