Configurate, working with YAML files

Hello!
I don’t do sponge plugins, but I do Spigot ones, due to Spigot’s API for configurations not preserving comments I wanted to test Sponge’s configurate.
As a first test I tried the mergeValuesFrom method as to update the config but it turns from:

#
# Enables Checking for update.
check-updates: true
#
# Available languages EN, PT, BG, RO, NO, CH
lang: 'en'
#
# The default npc cooldown in seconds
default-cooldown: 0

new-value: true

Into:
{check-updates: false, lang: en, default-cooldown: 0, new-value: true}
On the new file.
My code is is the same as the example.
Would it not work with Yaml?
Also does Yaml not preserve comments with this either?

It looks to me that you’re using a Json based loader to save, rather than the YAML one. Do you have the code you’re using to hand (pastebin/gist/github it). Without the code, it’s impossible to see what is going wrong (I know you said you were using an example, but the context you’re running it in would be better!).

Actually, YAML is a superset of JSON, for some reason. The output was correct. You’d need to set FlowStyle.BLOCK to make it tree-style output.
And no, configurate-yaml does not support comments (as YamlConfigurationLoader extends ConfigurationLoader<ConfigurationNode>, not ConfigurationLoader<CommentedConfigurationNode>. Configurate doesn’t roll any of its own parsers; it’s got a much better API than Bukkit’s but underneath it’s still using the same old snakeyaml parser which doesn’t support comments. And you’ll find that this is the case for virtually every YAML library, like Jackson or NightConfig. If I were you I’d switch to something modern like configurate-hocon or night-config:toml.