code: public Iterator<StreamBlock> iterator() {
          return new Iterator<StreamBlock>() {
              private Iterator<StreamBlock> m_memoryIterator = m_memoryDeque.iterator();
              @Override
              public boolean hasNext() {
                  if (m_memoryIterator.hasNext()) {
                      return true;
                  } else {
                      if (pollPersistentDeque(false) != null) {
                          m_memoryIterator = m_memoryDeque.iterator();
                          for (int ii = 0; ii < m_memoryDeque.size() - 1; ii++) {
                              m_memoryIterator.next();
                          }
                          return true;
                      }
                  }
                  return false;
              }
  
              @Override
              public StreamBlock next() {
                  if (m_memoryIterator.hasNext()) {
                      return m_memoryIterator.next();
                  }
  
                  StreamBlock block = pollPersistentDeque(false);
                  if (block == null) {
                      throw new java.util.NoSuchElementException();
                  } else {
                      m_memoryIterator = m_memoryDeque.iterator();
                      for (int ii = 0; ii < m_memoryDeque.size(); ii++) {
                          m_memoryIterator.next();
                      }
                      return block;
                  }
              }
  
              @Override
              public void remove() {
                  m_memoryIterator.remove();
              }
          };
      }
docs: /*
  Present an iterator that is backed by the blocks
  that are already loaded as well as blocks that
  haven't been polled from the persistent deque.
  
  The iterator wraps an iterator from the memoryDeque,
  and regenerates it every time an element is added to the memoryDeque from
  the persistent deque.