boolean (PsiVariable iterator, PsiElement context) { if (context == null) return false; final IteratorNextVisitor visitor = new IteratorNextVisitor(iterator, context); context.accept(visitor); return visitor.hasSimpleNextCall(); }