public CollectionAssert allElementsMatch ( String regex ) { isNotNull ( ) ; isNotEmpty ( ) ; for ( Object anActual : this . actual ) { if ( anActual == null ) { failWithMessageRelatedToRegex ( regex , anActual ) ; } String value = anActual . toString ( ) ; if ( ! value . matches ( regex ) ) { failWithMessageRelatedToRegex ( regex , value ) ; } } return this ; }
Asserts all elements of the collection whether they match a regular expression .