SemanticRules implements Serializable, SemanticRulesConfig.Producer { public SemanticRules(List<RuleBase> ruleBases) { this.ruleBases = ruleBases; } SemanticRules(List<RuleBase> ruleBases); @Override void getConfig(SemanticRulesConfig.Builder builder);  }
@Test public void semanticRulesTest() throws ParseException, IOException { SemanticRuleBuilder ruleBuilder = new SemanticRuleBuilder(); SemanticRules rules = ruleBuilder.build(FilesApplicationPackage.fromFile(new File(root))); SemanticRulesConfig.Builder configBuilder = new SemanticRulesConfig.Builder(); rules.getConfig(configBuilder); SemanticRulesConfig config = new SemanticRulesConfig(configBuilder); Map<String, RuleBase> ruleBases = toMap(config); assertEquals(2, ruleBases.size()); assertTrue(ruleBases.containsKey("common")); assertTrue(ruleBases.containsKey("other")); assertFalse(ruleBases.get("common").isDefault()); assertTrue(ruleBases.get("other").isDefault()); }