### Question:
Compiler { public Definition compile(SyntaxTree.Definition definition) { final String prefix = definition.prefix.orElse(""); final Map<String, HWModule> modules = compileModules(definition.moduleDefinitions, prefix); final Pair<List<Dependency>, List<NoStrictDependency>> rules = compileRules(definition.rules, modules); final Optional<AnonymousModule> whitelist = compileRegexesOrFail(definition.whiteList, "Some of the whitelist regular expressions are malformed"); final Optional<AnonymousModule> blacklist = compileRegexesOrFail(definition.blackList, "Some of the blacklist regular expressions are malformed"); final AnalysisMode mode = compileAnalysisMode(definition.mode); return new Definition(whitelist, blacklist, mode, modules.values(), rules.first, rules.second); }  Definition compile(SyntaxTree.Definition definition); static final String MODULE_REGEX_NOT_WELL_DEFINED; static final String MODULE_ALREADY_DEFINED; static final String MODULE_HAS_NOT_BEEN_DEFINED; }### Answer:
@Test @DisplayName("should fail of module regular expression fails to parse") void testFailModuleRegex() { assertThrows(CompilerException.class, () -> { final SyntaxTree.Definition definition = definitionBuilder.with($ -> { $.moduleDefinitions = Collections .singletonList(new SyntaxTree.ModuleDefinition("name", "invalidregex[")); $.rules = Collections.singletonList(new ChainDependencyRule("name", "name")); }).build(); testee.compile(definition); }