public Optional<YamlRuleConfiguration> swapToYamlRuleConfiguration(final Collection<RepositoryTuple> repositoryTuples, final Class<? extends YamlRuleConfiguration> toBeSwappedType) {
        RepositoryTupleEntity tupleEntity = toBeSwappedType.getAnnotation(RepositoryTupleEntity.class);
        if (null == tupleEntity) {
            return Optional.empty();
        }
        return tupleEntity.leaf()
                ? swapToYamlRuleConfiguration(repositoryTuples, toBeSwappedType, tupleEntity)
                : swapToYamlRuleConfiguration(repositoryTuples, toBeSwappedType, getFields(toBeSwappedType));
    }
@Test
    void assertSwapToYamlRuleConfigurationWithNodeYamlRuleConfiguration() {
        Optional<YamlRuleConfiguration> actual = new RepositoryTupleSwapperEngine().swapToYamlRuleConfiguration(Arrays.asList(
                new RepositoryTuple("/metadata/foo_db/rules/node/map_value/k/versions/0", "v"),
                new RepositoryTuple("/metadata/foo_db/rules/node/collection_value/versions/0", "- !LEAF" + System.lineSeparator() + "  value: foo"),
                new RepositoryTuple("/metadata/foo_db/rules/node/string_value/versions/0", "str"),
                new RepositoryTuple("/metadata/foo_db/rules/node/boolean_value/versions/0", "true"),
                new RepositoryTuple("/metadata/foo_db/rules/node/integer_value/versions/0", "1"),
                new RepositoryTuple("/metadata/foo_db/rules/node/long_value/versions/0", "10"),
                new RepositoryTuple("/metadata/foo_db/rules/node/enum_value/versions/0", "FOO")), NodeYamlRuleConfiguration.class);
        assertTrue(actual.isPresent());
        NodeYamlRuleConfiguration actualYamlConfig = (NodeYamlRuleConfiguration) actual.get();
        assertThat(actualYamlConfig.getMapValue().size(), is(1));
        assertThat(actualYamlConfig.getMapValue().get("k").getValue(), is("v"));
        assertThat(actualYamlConfig.getCollectionValue().size(), is(1));
        assertThat(actualYamlConfig.getCollectionValue().iterator().next().getValue(), is("foo"));
        assertThat(actualYamlConfig.getStringValue(), is("str"));
        assertTrue(actualYamlConfig.getBooleanValue());
        assertThat(actualYamlConfig.getIntegerValue(), is(1));
        assertThat(actualYamlConfig.getLongValue(), is(10L));
        assertThat(actualYamlConfig.getEnumValue(), is(NodeYamlRuleConfigurationEnum.FOO));
    }