@Override
    public YamlShardingRuleConfiguration swapToYamlConfiguration(final ShardingRuleConfiguration data) {
        YamlShardingRuleConfiguration result = new YamlShardingRuleConfiguration();
        data.getTables().forEach(each -> result.getTables().put(each.getLogicTable(), tableSwapper.swapToYamlConfiguration(each)));
        data.getAutoTables().forEach(each -> result.getAutoTables().put(each.getLogicTable(), autoTableSwapper.swapToYamlConfiguration(each)));
        result.getBindingTables().addAll(data.getBindingTableGroups().stream().map(YamlShardingTableReferenceRuleConfigurationConverter::convertToYamlString).collect(Collectors.toList()));
        setYamlStrategies(data, result);
        setYamlAlgorithms(data, result);
        result.setDefaultShardingColumn(data.getDefaultShardingColumn());
        if (null != data.getShardingCache()) {
            result.setShardingCache(shardingCacheSwapper.swapToYamlConfiguration(data.getShardingCache()));
        }
        return result;
    }
@Test
    void assertSwapToYamlConfiguration() {
        YamlShardingRuleConfiguration actual = getSwapper().swapToYamlConfiguration(createMaximumShardingRuleConfiguration());
        assertThat(actual.getTables().size(), is(2));
        assertThat(actual.getAutoTables().size(), is(1));
        assertThat(actual.getBindingTables().size(), is(1));
        assertYamlStrategies(actual);
        assertYamlAlgorithms(actual);
        assertThat(actual.getDefaultShardingColumn(), is("table_id"));
        assertThat(actual.getShardingCache().getAllowedMaxSqlLength(), is(100));
    }