class LockedCollection<E> extends ReentrantLock implements Collection<E> {
        /** */
        private static final long serialVersionUID = 0L;

        /** Delegating collection. */
        protected final Collection<E> c;

        /**
         * @param c Delegating collection.
         */
        private LockedCollection(Collection<E> c) {
            this.c = c;
        }

        /** {@inheritDoc} */
        @Override public boolean add(E e) {
            lock();

            try {
                return c.add(e);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public int size() {
            lock();

            try {
                return c.size();
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean isEmpty() {
            lock();

            try {
                return c.isEmpty();
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean contains(Object o) {
            lock();

            try {
                return c.contains(o);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public Iterator<E> iterator() {
            return c.iterator(); // Must be manually synced by user.
        }

        /** {@inheritDoc} */
        @Override public Object[] toArray() {
            lock();

            try {
                return c.toArray();
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @SuppressWarnings({"SuspiciousToArrayCall"})
        @Override public <T> T[] toArray(T[] a) {
            lock();

            try {
                return c.toArray(a);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean remove(Object o) {<FILL_FUNCTION_BODY>}

        /** {@inheritDoc} */
        @Override public boolean containsAll(Collection<?> c) {
            lock();

            try {
                return this.c.containsAll(c);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean addAll(Collection<? extends E> c) {
            lock();

            try {
                return this.c.addAll(c);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean removeAll(Collection<?> c) {
            lock();

            try {
                return this.c.removeAll(c);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean retainAll(Collection<?> c) {
            lock();

            try {
                return this.c.retainAll(c);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public void clear() {
            lock();

            try {
                c.clear();
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public int hashCode() {
            lock();

            try {
                return c.hashCode();
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public boolean equals(Object o) {
            lock();

            try {
                return c.equals(o);
            }
            finally {
                unlock();
            }
        }

        /** {@inheritDoc} */
        @Override public String toString() {
            lock();

            try {
                return c.toString();
            }
            finally {
                unlock();
            }
        }

        /**
         * Overrides write object.
         *
         * @param s Object output stream.
         * @throws IOException If failed.
         */
        private void writeObject(ObjectOutputStream s) throws IOException {
            lock();

            try {
                s.defaultWriteObject();
            }
            finally {
                unlock();
            }
        }
    }

            lock();

            try {
                return c.remove(o);
            }
            finally {
                unlock();
            }
        
<no_super_class>