EncryptRuleConfigurationYamlSwapper implements YamlRuleConfigurationSwapper<YamlEncryptRuleConfiguration, EncryptRuleConfiguration> { @Override public YamlEncryptRuleConfiguration swapToYamlConfiguration(final EncryptRuleConfiguration data) { YamlEncryptRuleConfiguration result = new YamlEncryptRuleConfiguration(); data.getTables().forEach(each -> result.getTables().put(each.getName(), tableYamlSwapper.swapToYamlConfiguration(each))); data.getEncryptors().forEach((key, value) -> result.getEncryptors().put(key, algorithmSwapper.swapToYamlConfiguration(value))); return result; }  @Override YamlEncryptRuleConfiguration swapToYamlConfiguration(final EncryptRuleConfiguration data); @Override EncryptRuleConfiguration swapToObject(final YamlEncryptRuleConfiguration yamlConfig); @Override Class<EncryptRuleConfiguration> getTypeClass(); @Override String getRuleTagName(); @Override int getOrder();  }
@Test public void assertSwapToYamlConfiguration() { YamlEncryptRuleConfiguration actual = getSwapper().swapToYamlConfiguration(createEncryptRuleConfiguration()); assertThat(actual.getTables().size(), is(1)); assertThat(actual.getEncryptors().size(), is(1)); }