@Override
  @NotNull
  public <T extends PsiElement> Iterator<Location<T>> getAncestors(final Class<T> ancestorClass, final boolean strict) {
    final Iterator<Location<T>> fromClass = myClassLocation.getAncestors(ancestorClass, false);
    if (strict) return fromClass;
    return new Iterator<>() {
      private boolean myFirstStep = ancestorClass.isInstance(myMethod);

      @Override
      public boolean hasNext() {
        return myFirstStep || fromClass.hasNext();
      }

      @Override
      public Location<T> next() {
        final Location<T> location = myFirstStep ? (Location<T>)MethodLocation.this : fromClass.next();
        myFirstStep = false;
        return location;
      }

      @Override
      public void remove() {
        LOG.assertTrue(false);
      }
    };
  }
@Override
  @NotNull
  public <T extends PsiElement> Iterator<Location<T>> getAncestors(final Class<T> ancestorClass, final boolean strict)