  @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"))));
  }