### Question:
RegexPredicate implements Predicate<String> { public static Predicate<String> createAllowlistFromPatterns(InputStream resource) { List<Pattern> patterns = createPatternsFromInputStream(resource); return new RegexPredicate(patterns); } 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 createAllowlistFromPatternsWhenInvalidRegexThenUsefulException() { assertThatCode(() -> RegexPredicate.createAllowlistFromPatterns(inputStream("{v}"))) .isInstanceOf(PatternSyntaxException.class); }