@Override
    public ShardingRuleConfiguration swapToObject(final YamlShardingRuleConfiguration yamlConfig) {
        ShardingRuleConfiguration result = new ShardingRuleConfiguration();
        for (Entry<String, YamlTableRuleConfiguration> entry : yamlConfig.getTables().entrySet()) {
            YamlTableRuleConfiguration tableRuleConfig = entry.getValue();
            tableRuleConfig.setLogicTable(entry.getKey());
            result.getTables().add(tableSwapper.swapToObject(tableRuleConfig));
        }
        for (Entry<String, YamlShardingAutoTableRuleConfiguration> entry : yamlConfig.getAutoTables().entrySet()) {
            YamlShardingAutoTableRuleConfiguration tableRuleConfig = entry.getValue();
            tableRuleConfig.setLogicTable(entry.getKey());
            result.getAutoTables().add(autoTableSwapper.swapToObject(tableRuleConfig));
        }
        result.getBindingTableGroups().addAll(yamlConfig.getBindingTables().stream().map(YamlShardingTableReferenceRuleConfigurationConverter::convertToObject).collect(Collectors.toList()));
        setStrategies(yamlConfig, result);
        setAlgorithms(yamlConfig, result);
        result.setDefaultShardingColumn(yamlConfig.getDefaultShardingColumn());
        if (null != yamlConfig.getShardingCache()) {
            result.setShardingCache(shardingCacheSwapper.swapToObject(yamlConfig.getShardingCache()));
        }
        return result;
    }
@Test
    void assertSwapToObject() {
        ShardingRuleConfiguration actual = getSwapper().swapToObject(createYamlShardingRuleConfiguration());
        assertThat(actual.getTables().size(), is(1));
        assertThat(actual.getAutoTables().size(), is(1));
        assertThat(actual.getBindingTableGroups().size(), is(1));
        assertStrategies(actual);
        assertAlgorithms(actual);
        assertThat(actual.getDefaultShardingColumn(), is("table_id"));
        assertThat(actual.getShardingCache().getAllowedMaxSqlLength(), is(100));
    }