class HugeLongArrayQueue {

    public long remove() {
        if (isEmpty()) {
            throw new IndexOutOfBoundsException("Queue is empty.");
        }
        long removed = array.get(head);
        head = (head + 1) % capacity;
        return removed;
    }

    private  HugeLongArrayQueue(HugeLongArray array);

}