### Question:
RegexFilePathMatcher implements FilePathMatcher { public void setPatterns(final String... patterns) throws IllegalArgumentException { if (ArrayUtils.isEmpty(patterns)) { throw new IllegalArgumentException("a RegexFilePathMatcher needs at least one pattern"); } this.inputPatterns = patterns; this.validator = new RegexValidator(patterns); } RegexFilePathMatcher(final String... inputPatterns); boolean isMatch(final String path); void setPatterns(final String... patterns);  }### Answer:
@Test public final void setPatterns() throws Exception { String path1 = "/foo.txt"; String path2 = "/bar.txt"; String patterns1 = "/foo.txt"; String[] patterns2 = {"/foo.txt", "/bar.txt"}; RegexFilePathMatcher matcher = new RegexFilePathMatcher(patterns1); Assert.assertTrue(matcher.isMatch(path1)); Assert.assertFalse(matcher.isMatch(path2)); matcher.setPatterns(patterns2); Assert.assertTrue(matcher.isMatch(path1)); Assert.assertTrue(matcher.isMatch(path2)); }