class SqlPartIterator implements Iterator<SqlPart> {

  @Override
  public SqlPart next() {
    if (mLastReturned == null) {
      mLastReturned = mFirst;
      return mFirst;
    }

    SqlPart next = mLastReturned.previous();
    if (next == null) {
      throw new NoSuchElementException("No previous SqlPart.");
    }

    mLastReturned = next;
    return mLastReturned;
  }

    SqlPartIterator(@NotNull final SqlPart first);

}