@Override
    public YamlAuthorityRuleConfiguration swapToYamlConfiguration(final AuthorityRuleConfiguration data) {
        YamlAuthorityRuleConfiguration result = new YamlAuthorityRuleConfiguration();
        result.setPrivilege(algorithmSwapper.swapToYamlConfiguration(data.getPrivilegeProvider()));
        result.setUsers(data.getUsers().stream().map(userSwapper::swapToYamlConfiguration).collect(Collectors.toList()));
        result.setDefaultAuthenticator(data.getDefaultAuthenticator());
        data.getAuthenticators().forEach((key, value) -> result.getAuthenticators().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
        return result;
    }
@Test
    void assertSwapToYamlConfiguration() {
        AuthorityRuleConfiguration authorityRuleConfig = new AuthorityRuleConfiguration(Collections.emptyList(), new AlgorithmConfiguration("ALL_PERMITTED", new Properties()),
                Collections.singletonMap("md5", createAlgorithmConfiguration()), "scram_sha256");
        YamlAuthorityRuleConfiguration actual = swapper.swapToYamlConfiguration(authorityRuleConfig);
        assertTrue(actual.getUsers().isEmpty());
        assertNotNull(actual.getPrivilege());
        assertThat(actual.getDefaultAuthenticator(), is("scram_sha256"));
        assertThat(actual.getAuthenticators().size(), is(1));
    }