spring-framework / org.springframework.util / CollectionUtils / hasUniqueObject

hasUniqueObject

open static fun hasUniqueObject(collection: MutableCollection<*>): Boolean

Determine whether the given Collection only contains a single unique object.

Parameters

collection - the Collection to check

Return
true if the collection contains a single reference or multiple references to the same instance, false else