### Question:
YamlDocGenerator { public String generate(String schemaName) { return generate(schemaName, schema); } YamlDocGenerator(Map<String, Object> schema); String generate(String schemaName); String generate(String reference, Map<String, Object> schema); void useKubernetesVersion(String k8sVersion); String getKubernetesSchemaMarkdown(); String getKubernetesSchemaMarkdownFile();  }### Answer:
@Test public void generateMarkdownForSimpleObjectWithHeader() { Map<String, Object> schema = generateSchema(SimpleObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("simpleObject"); assertThat( markdown, containsString( String.join( "\n", "### Simple Object", "", tableHeader(), tableEntry("`aaBoolean`", "Boolean", "A flag"), tableEntry("`aaString`", "string", "A string"), tableEntry("`depth`", "number", "")))); }
@Test public void generateMarkdownForObjectWithReferences() { Map<String, Object> schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("start"); assertThat( markdown, containsString( String.join( "\n", "### Start", "", tableHeader(), tableEntry("`deprecatedField`", "number", ""), tableEntry("`derived`", linkTo("Derived Object", "#derived-object"), ""), tableEntry("`simple`", linkTo("Simple Object", "#simple-object"), "")))); }
@Test public void generateMarkdownWithReferencedSections() { Map<String, Object> schema = generateSchema(ReferencingObject.class); YamlDocGenerator generator = new YamlDocGenerator(schema); String markdown = generator.generate("start"); assertThat( markdown, containsString( String.join( "\n", "### Start", "", tableHeader(), tableEntry("`deprecatedField`", "number", ""), tableEntry("`derived`", linkTo("Derived Object", "#derived-object"), ""), tableEntry("`simple`", linkTo("Simple Object", "#simple-object"), ""), "", "### Derived Object", "", "A simple object used for testing", "", tableHeader(), tableEntry("`aaBoolean`", "Boolean", "A flag"), tableEntry("`aaString`", "string", "A string")))); }