### Question:
RegexHttpMatcher implements HttpMatcher, HttpReplacer { public void setHttpReplacer(Function<String, String> httpReplacer) { if (httpReplacer == null) { throw new IllegalArgumentException("httpReplacer cannot be null"); } this.httpReplacer = httpReplacer; } 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 setReplacerWhenNullThenIllegalArgumentException() { Function<String, String> replacer = null; assertThatCode(() -> this.matcher.setHttpReplacer(replacer)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("httpReplacer cannot be null"); }