public < E > Iterable < E > searchForAll ( final Collection < E > collection ) { Assert . notNull ( collection , "The collection to search cannot be null!" ) ; final List < E > results = new ArrayList <> ( collection . size ( ) ) ; for ( E element : collection ) { if ( getMatcher ( ) . isMatch ( element ) ) { results . add ( element ) ; } } return results ; }
Searches a collection of elements finding all elements in the collection matching the criteria defined by the Matcher .