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

containsInstance

open static fun containsInstance(@Nullable collection: MutableCollection<*>, element: Any): Boolean

Check whether the given Collection contains the given element instance.

Enforces the given instance to be present, rather than returning true for an equal element as well.

Parameters

collection - the Collection to check

element - the element to look for

Return
true if found, false else