Collection<YAMLKeyValue> (final YAMLFile file) { final YAMLValue topLevelValue = file.getDocuments().get(0).getTopLevelValue(); if (topLevelValue instanceof YAMLMapping) { return ((YAMLMapping)topLevelValue).getKeyValues(); } else { return Collections.emptyList(); } }