boolean (PsiElement variable) { if (variable instanceof PsiLocalVariable && ((PsiLocalVariable)variable).getInitializer() != null || variable instanceof PsiParameter && ((PsiParameter)variable).getDeclarationScope() instanceof PsiForeachStatement) { PsiTypeElement typeElement = ((PsiVariable)variable).getTypeElement(); if (typeElement != null) { String text = typeElement.getText(); if (LOMBOK_VAL_SHORT_NAME.equals(text) || LOMBOK_VAL_FQN.equals(text)) { return true; } } } return false; }