MarkdownList (@NotNull Project project, boolean ordered) { final String contents; if (ordered) { contents = "1) list item"; } else { contents = "* list item"; } final var file = createFile(project, contents); final var list = Objects.requireNonNull(file.getFirstChild()); assert(list instanceof MarkdownList); for (final var child: list.getChildren()) { child.delete(); } return (MarkdownList)list; }