RegexMatcher extends AbstractSimpleStringMatcher { @Override protected boolean matches(String actual, String argument) { return actual != null && argument != null && actual.matches(argument); }    }
@Test public void testWhenActualIsNull() { assertThat(new RegexMatcher().matches(null, ""), is(false)); }
@Test public void testWhenPatternIsNull() { assertThat(new RegexMatcher().matches("", null), is(false)); }
@Test public void testWhenItemMatchesPatternPartially() { assertThat(new RegexMatcher().matches("hello", "lo"), is(false)); }
@Test public void testWhenItemDoesNotMatchPatternInAnyWay() { assertThat(new RegexMatcher().matches("hello", "\\d+"), is(false)); }
@Test public void testWhenItemMatchesPattern() { assertThat(new RegexMatcher().matches("12345", "\\d+"), is(true)); }