public void rebuild() {
        rules.removeIf(YamlGlobalRuleConfiguration.class::isInstance);
        if (null != authority) {
            rules.add(authority);
        }
        if (null != sqlParser) {
            rules.add(sqlParser);
        }
        if (null != transaction) {
            rules.add(transaction);
        }
        if (null != globalClock) {
            rules.add(globalClock);
        }
        if (null != sqlFederation) {
            rules.add(sqlFederation);
        }
        if (null != sqlTranslator) {
            rules.add(sqlTranslator);
        }
        if (null != logging) {
            rules.add(logging);
        }
    }
@Test
    void assertRebuild() {
        YamlJDBCConfiguration actual = new YamlJDBCConfiguration();
        YamlAuthorityRuleConfiguration authorityRuleConfig = new YamlAuthorityRuleConfiguration();
        actual.setAuthority(authorityRuleConfig);
        YamlSQLParserRuleConfiguration sqlParserRuleConfig = new YamlSQLParserRuleConfiguration();
        actual.setSqlParser(sqlParserRuleConfig);
        YamlTransactionRuleConfiguration transactionRuleConfig = new YamlTransactionRuleConfiguration();
        actual.setTransaction(transactionRuleConfig);
        YamlGlobalClockRuleConfiguration globalClockRuleConfig = new YamlGlobalClockRuleConfiguration();
        actual.setGlobalClock(globalClockRuleConfig);
        YamlSQLFederationRuleConfiguration sqlFederationRuleConfig = new YamlSQLFederationRuleConfiguration();
        actual.setSqlFederation(sqlFederationRuleConfig);
        YamlSQLTranslatorRuleConfiguration sqlTranslatorRuleConfig = new YamlSQLTranslatorRuleConfiguration();
        actual.setSqlTranslator(sqlTranslatorRuleConfig);
        YamlLoggingRuleConfiguration loggingRuleConfig = new YamlLoggingRuleConfiguration();
        actual.setLogging(loggingRuleConfig);
        actual.rebuild();
        assertThat(actual.getRules(), is(Arrays.asList(
                authorityRuleConfig, sqlParserRuleConfig, transactionRuleConfig, globalClockRuleConfig, sqlFederationRuleConfig, sqlTranslatorRuleConfig, loggingRuleConfig)));
    }