code: public List<T> getEvents() {
          List<T> returnEvents = new ArrayList<T>();
  
          if (bufferedEvents.isEmpty()) {
              return returnEvents;
          }
  
          int returnSize = isBufferFull() ? bufferSize : bufferedEvents.size();
  
          for (int i = 0 ; i < returnSize ; i++) {
              returnEvents.add(bufferedEvents.remove(0));
          }
  
          return returnEvents;
      }
docs: Get a list of objects held by the buffer.
  <p>
  The number of returned objects will be from zero to the configured buffer size.
  
  @return a <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html">List</a> containing the buffered
  objects.