class Iter implements Iterator<E> {
        /** */
        private final Iterator<E> iter;

        /** */
        private Iter(Iterator<E> iter) {
            this.iter = iter;
        }

        /** {@inheritDoc} */
        @Override public boolean hasNext() {
            return iter.hasNext();
        }

        /** {@inheritDoc} */
        @Override public E next() {
            return iter.next();
        }

        /** {@inheritDoc} */
        @Override public void remove() {
            iter.remove();

            adder.decrement();
        }

        /** {@inheritDoc} */
        @Override public void forEachRemaining(Consumer<? super E> consumer) {
            iter.forEachRemaining(consumer);
        }
    }

    /** Underlying deque. */
    private final Deque<E> deque;

    /** Size. */
    private final LongAdder adder = new LongAdder();

    /** Creates a decorator.
     *
     * @param deque Deque being decorated.
     */
    public FastSizeDeque(Deque<E> deque) {
        this.deque = Objects.requireNonNull(deque);
    }

    /**
     * Fast size getter.
     *
     * @return Deque size.
     */
    public int sizex() {
        return adder.intValue();
    }

    /**
     * Tests this deque for emptiness.; equivalent to {@code sizex() == 0}.
     *
     * @return {@code True} if this deque is empty.
     */
    public boolean isEmptyx() {
        return adder.intValue() == 0;
    }

    /** {@inheritDoc} */
    @Override public void addFirst(E e) {
        deque.addFirst(e);

        adder.increment();
    }

    /** {@inheritDoc} */
    @Override public void addLast(E e) {
        deque.addLast(e);

        adder.increment();
    }

    /** {@inheritDoc} */
    @Override public boolean offerFirst(E e) {
        boolean res = deque.offerFirst(e);

        if (res)
            adder.increment();

        return res;
    }

    /** {@inheritDoc} */
    @Override public boolean offerLast(E e) {
        boolean res = deque.offerLast(e);

        if (res)
            adder.increment();

        return res;
    }

    /** {@inheritDoc} */
    @Override public E removeFirst() {
        E res = deque.removeFirst();

        adder.decrement();

        return res;
    }

    /** {@inheritDoc} */
    @Override public E removeLast() {
        E res = deque.removeLast();

        adder.decrement();

        return res;
    }

    /** {@inheritDoc} */
    @Override public E pollFirst() {<FILL_FUNCTION_BODY>

        E res = deque.pollFirst();

        if (res != null)
            adder.decrement();

        return res;
    
<no_super_class>