@Override
    public ShardingStrategyConfiguration swapToObject(final YamlShardingStrategyConfiguration yamlConfig) {
        int shardingStrategyConfigCount = 0;
        ShardingStrategyConfiguration result = null;
        if (null != yamlConfig.getStandard()) {
            shardingStrategyConfigCount++;
            result = createStandardShardingStrategyConfiguration(yamlConfig.getStandard());
        }
        if (null != yamlConfig.getComplex()) {
            shardingStrategyConfigCount++;
            result = createComplexShardingStrategyConfiguration(yamlConfig.getComplex());
        }
        if (null != yamlConfig.getHint()) {
            shardingStrategyConfigCount++;
            result = createHintShardingStrategyConfiguration(yamlConfig.getHint());
        }
        if (null != yamlConfig.getNone()) {
            shardingStrategyConfigCount++;
            result = new NoneShardingStrategyConfiguration();
        }
        ShardingSpherePreconditions.checkState(shardingStrategyConfigCount <= 1, InvalidShardingStrategyConfigCountException::new);
        return result;
    }
@Test
    void assertSwapToObjectForNoneShardingStrategy() {
        YamlShardingStrategyConfiguration yamlConfig = new YamlShardingStrategyConfiguration();
        yamlConfig.setNone(new YamlNoneShardingStrategyConfiguration());
        YamlShardingStrategyConfigurationSwapper swapper = new YamlShardingStrategyConfigurationSwapper();
        ShardingStrategyConfiguration actual = swapper.swapToObject(yamlConfig);
        assertThat(actual, instanceOf(NoneShardingStrategyConfiguration.class));
    }