hasOnly<T>(): boolean
Checks whether a list contains only the specified values.
The order of values does not matter, but the list must contain every specified value and must not contain any additional values. Duplicate values are ignored, since both the list and expected values are compared as sets.