public synchronized T get(int index) {
    if (index >= 0 && index < size) {
      return buffer[(head + index) % capacity];
    }
    throw new CliException("OutOfBoundaryError");
  }
A queue that supports random access and consumption.
@param <T> Element type
samza-sql-shell/src/main/java/org/apache/samza/sql/client/util/RandomAccessQueue.java