firstMatch

public static T firstMatch<T>(Collection<T> objects, Matcher<? super T> matcher)(source)

Returns the object in the given collection matched by the given matcher with the highest match score.

If there is not such an object, null is returned.

Return

the matched object or null

Parameters

objects

the collection of objects

matcher

the matcher

<T>

the type of objects