class EnumBitFieldIterator<E extends Enum<E>> implements Iterator<E> {
        int nextIndex;
        int lastReturnedIndex = -1;

        EnumBitFieldIterator() {
            nextIndex = -1;
            findNext();
        }

        public boolean hasNext() {
            return nextIndex < universe.length;
        }

        @SuppressWarnings("unchecked")
        public E next() {
            if (nextIndex >= universe.length)
                throw new NoSuchElementException();

            lastReturnedIndex = nextIndex;
            findNext();

            return (E) universe[lastReturnedIndex];
        }

        void findNext() {
            do {
                nextIndex++;
                if (nextIndex >= universe.length) break;
            } while ((elements & bitMasks[nextIndex]) == 0);
        }

        public void remove() {
            if (lastReturnedIndex == -1)
                throw new IllegalStateException();
            elements &= ~bitMasks[lastReturnedIndex];
            lastReturnedIndex = -1;
        }
    }

    /**
     * Returns the number of elements in this set.
     *
     * @return the number of elements in this set
     */
    public int size() {
        return totalBits;
    }

    /**
     * @return true if this set contains no elements
     */
    public boolean isEmpty() {
        return elements == 0;
    }

    /**
     * Returns true if this set contains the specified element.
     *
     * @param e element to be checked for containment in this collection
     * @return true if this set contains the specified element
     */
    public boolean contains(Object e) {
        if (e == null)
            return false;
        Class<?> eClass = e.getClass();
        if (eClass != elementType && eClass.getSuperclass() != elementType)
            return false;

        return (elements & bitMasks[((Enum<?>) e).ordinal()]) != 0;
    }

    // Modification Operations

    /**
     * Adds the specified element to this set if it is not already present.
     *
     * @param e element to be added to this set
     * @return true if the set changed as a result of the call
     * @throws NullPointerException if e is null
     */
    public boolean add(E e) {
        typeCheck(e);

        long oldElements = elements;
        elements |= bitMasks[e.ordinal()];
        return elements != oldElements;
    }

    /**
     * Removes the specified element from this set if it is present.
     *
     * @param e element to be removed from this set, if present
     * @return true if the set contained the specified element
     */
    public boolean remove(Object e) {
        if (e == null)
            return false;
        Class<?> eClass = e.getClass();
        if (eClass != elementType && eClass.getSuperclass() != elementType)
            return false;

        long oldElements = elements;
        elements &= ~bitMasks[((Enum<?>) e).ordinal()];
        return elements != oldElements;
    }

    // Bulk Operations

    /**
     * Returns true if this set contains all of the elements
     * in the specified collection.
     *
     * @param c collection to be checked for containment in this set
     * @return true if this set contains all of the elements
     *         in the specified collection
     * @throws NullPointerException if the specified collection is null
     */
    public boolean containsAll(Collection<?> c) {<FILL_FUNCTION_BODY>

        if (!(c instanceof BitFieldSet))
            return super.containsAll(c);

        BitFieldSet<?> es = (BitFieldSet<?>) c;
        if (es.elementType != elementType)
            return es.isEmpty();

        return (es.elements & ~elements) == 0;
    
<methods>public boolean equals(java.lang.Object) ,public int hashCode() ,public boolean removeAll(Collection<?>) <variables>