@Override
        public T next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            return buffer[i++];
        }
Ring buffer (fixed size queue) implementation using a circular array (array
with wrap-around).
jme3-android/src/main/java/com/jme3/util/RingBuffer.java