PatternCollection { public boolean anyMatch(String text) { return patterns.stream() .anyMatch(pattern -> pattern.matcher(text).find()); } PatternCollection(List<Pattern> patterns); boolean anyMatch(String text);  }
@Test public void matching_one_pattern() { assertThat(patternCollection.anyMatch("afoolol")).isTrue(); }
@Test public void matching_two_patterns() { assertThat(patternCollection.anyMatch("foobar")).isTrue(); }
@Test public void matching_zero_patterns() { assertThat(patternCollection.anyMatch("bbbbb")).isFalse(); }