class HugeLongArrayQueue {

    public void add(long v) {
        long newTail = (tail + 1) % capacity;
        if (newTail == head) {
            throw new IndexOutOfBoundsException("Queue is full.");
        }
        array.set(tail, v);
        tail = newTail;
    }

    private  HugeLongArrayQueue(HugeLongArray array);

}