### Question:
RegexPredicate implements Predicate<String> { @Override public boolean test(String httpText) { return this.patterns.stream() .anyMatch(p -> p.matcher(httpText).matches()); } RegexPredicate(List<Pattern> patterns); @Override boolean test(String httpText); static Predicate<String> createDefaultUrlAllowlist(); static Predicate<String> createAllowlistFromPatterns(InputStream resource); @Deprecated static Predicate<String> createDefaultUrlWhitelist(); @Deprecated static Predicate<String> createWhitelistFromPatterns(InputStream resource);  }### Answer:
@Test public void testWhenMatchAllThenMatch() { RegexPredicate test = new RegexPredicate(Arrays.asList(Pattern.compile(".*"))); assertThat(test.test("foo")).isTrue(); }
@Test public void testWhenNotMatchThenNoMatch() { RegexPredicate test = new RegexPredicate(Arrays.asList(Pattern.compile("^$"))); assertThat(test.test("foo")).isFalse(); }
@Test public void testWhenNotMatchAndMatchThenNoMatch() { RegexPredicate test = new RegexPredicate(Arrays.asList(Pattern.compile("^$"), Pattern.compile(".*"))); assertThat(test.test("foo")).isTrue(); }
@Test public void testWhenNoDotThenAllowlisted() { assertThat(this.allowlist.test("http: }