boolean (PsiSwitchStatement statement) { final PsiExpression expression = statement.getExpression(); if (expression == null) { return false; } final PsiType type = expression.getType(); if (type == null) { return false; } if (!(type instanceof PsiClassType)) { return false; } final PsiClass aClass = ((PsiClassType)type).resolve(); return aClass != null && aClass.isEnum(); }