Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all of its elements that are not contained in the specified collection.
@param c collection containing elements to be retained in this list
@return {@code true} if this list changed as a result of the call
@throws ClassCastException if the class of an element of this listis incompatible with the specified collection (
optional)
@throws NullPointerException if this list contains a null element and thespecified collection does not permit null elements (
optional), or if the specified collection is null
@see Collection#contains(Object)