code: @Override
      public Iterator<T> iterator() {
          List<T> bufferAsList = new ArrayList<T>();
          synchronized (this) {
              synchronized (lock) {
                  //First add the items in the expedited buffer
                  //Check if we wrap around the end of the array before iterating
                  if (expeditedPutIndex > expeditedTakeIndex) {
                      for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) {
                          bufferAsList.add(expeditedBuffer[i]);
                      }
                  } else {
                      //We wrap around the array. Loop through in two passes(upper and lower)
                      for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) {
                          bufferAsList.add(expeditedBuffer[i]);
                      }
                      for (int i = 0; i < expeditedPutIndex; i++) {
                          bufferAsList.add(expeditedBuffer[i]);
                      }
                  }
                  //Next add the items in the main buffer
                  //Check if we wrap around the end of the array before iterating
                  if (putIndex > takeIndex) {
                      for (int i = takeIndex; i <= putIndex; i++) {
                          bufferAsList.add(buffer[i]);
                      }
                  } else {
                      //We wrap around the array. Loop through in two passes(upper and lower)
                      for (int i = takeIndex; i < buffer.length; i++) {
                          bufferAsList.add(buffer[i]);
                      }
                      for (int i = 0; i < putIndex; i++) {
                          bufferAsList.add(buffer[i]);
                      }
                  }
              }
          }
          return bufferAsList.iterator();
      }
docs: /*
  @awisniew - ADDED
  
  (non-Javadoc)
  
  @see java.util.Collection#iterator()