@Test public void testMatchingWithNullInputs(){ Assert.assertFalse(new RegexMatcher(null).matching(null)); Assert.assertFalse(new RegexMatcher(null).matching("foobar")); Assert.assertFalse(new RegexMatcher("foobar").matching(null)); Assert.assertTrue(new RegexMatcher("foobar").matching("foobar")); }
@Override public boolean matching(String target) { return null != target && null != pattern && target.matches(pattern); }
RegexMatcher implements Matcher<String> { @Override public boolean matching(String target) { return null != target && null != pattern && target.matches(pattern); } }
RegexMatcher implements Matcher<String> { @Override public boolean matching(String target) { return null != target && null != pattern && target.matches(pattern); } RegexMatcher(String pattern); }
RegexMatcher implements Matcher<String> { @Override public boolean matching(String target) { return null != target && null != pattern && target.matches(pattern); } RegexMatcher(String pattern); @Override boolean matching(String target); }
RegexMatcher implements Matcher<String> { @Override public boolean matching(String target) { return null != target && null != pattern && target.matches(pattern); } RegexMatcher(String pattern); @Override boolean matching(String target);  }