PatternMatcher implements StringMatcher { @Override public boolean test(String value) { return !value.isEmpty() && pattern.matcher(value).matches(); } PatternMatcher(String regex); @Override boolean test(String value);  }
@Test void should_match_patterns() { matcher = new PatternMatcher("[a-z]*"); assertThat(matcher.test("test")).isTrue(); assertThat(matcher.test("012")).isFalse(); }