- private static Matcher<String> matches(final String regex) {
- return new TypeSafeMatcher<String>() {
- @Override
- protected boolean matchesSafely(String item) {
- return compile(regex).matcher(item).find();
- }
-
- @Override
- public void describeTo(Description description) {
- description.appendText("matches: ").appendValue(regex);
- }
- };
- }
-