PsiElement (final PsiClass aClass) { final PsiForeachStatement foreachStatement = PsiTreeUtil.findChildOfType(aClass, PsiForeachStatement.class); assert foreachStatement != null : aClass.getText(); return foreachStatement.getIterationParameter(); }