boolean (@NotNull final PsiElement element) { if (element instanceof PsiVariable && ((PsiVariable)element).getInitializer() != null) { return true; } if (element instanceof PsiParameter && ((PsiParameter)element).getDeclarationScope() instanceof PsiForeachStatement) { return true; } return false; }