Location<T> () { if (myCurrent == null) throw new NoSuchElementException(); final PsiLocation<T> psiLocation = new PsiLocation<>(myProject, myCurrent); myCurrent = findNext(myCurrent, ancestorClass); return psiLocation; }