public static boolean removeAllIterable(Set<?> collection, Iterable<?> iterable)
    {
        if (iterable instanceof Set<?> && ((Set<?>) iterable).size() > collection.size())
        {
            boolean modified = false;
            Iterator<?> e = collection.iterator();
            while (e.hasNext())
            {
                if (((Set<?>) iterable).contains(e.next()))
                {
                    e.remove();
                    modified = true;
                }
            }
            return modified;
        }

        boolean modified = false;
        for (Object each : iterable)
        {
            if (collection.remove(each))
            {
                modified = true;
            }
        }
        return modified;
    }
public static boolean removeAllIterable ( Set < ? > collection , Iterable < ? > iterable ) { if ( iterable instanceof Set < ? > && ( ( Set < ? > ) iterable ) . size ( ) > collection . size ( ) ) { boolean modified = false ; Iterator < ? > e = collection . iterator ( ) ; while ( e . hasNext ( ) ) { if ( ( ( Set < ? > ) iterable ) . contains ( e . next ( ) ) ) { e . remove ( ) ; modified = true ; } } return modified ; } boolean modified = false ; for ( Object each : iterable ) { if ( collection . remove ( each ) ) { modified = true ; } } return modified ; }
@see Collection#removeAll(Collection)
@since 1.0