retainAll

open override fun retainAll(elements: Collection<T>): Boolean

Retains only the elements in this set that are contained in the specified set.

Return

true if any element was removed from the set, false if the set was not modified.

Throws

if any of elements doesn't present in the map.