### Question:
RegexHttpMatcher implements HttpMatcher, HttpReplacer { public void setPattern(Pattern pattern) { if (pattern == null) { throw new IllegalArgumentException("pattern cannot be null"); } this.pattern = pattern; } RegexHttpMatcher(Predicate<String> allow); void setPattern(Pattern pattern); void setHttpReplacer(Function<String, String> httpReplacer); List<HttpMatchResult> findHttp(String text); HttpReplaceResult replaceHttp(String text); void addHttpAllow(Predicate<String> allow); void addHttpWhitelist(Predicate<String> whitelist);  }### Answer:
@Test public void setPatternWhenNullThenIllegalArgumentException() { Pattern pattern = null; assertThatCode(() -> this.matcher.setPattern(pattern)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("pattern cannot be null"); }