MarkdownList ( @NotNull Project project, @NotNull Iterable<@NotNull String> items, @NotNull Function<? super Integer, String> markerSupplier ) { final var builder = new StringBuilder(); var itemIndex = 0; for (final var item: items) { builder.append(markerSupplier.apply(itemIndex)); builder.append(" "); builder.append(item); builder.append("\n"); itemIndex += 1; } final var file = createFile(project, builder.toString()); final var list = Objects.requireNonNull(file.getFirstChild()); assert(list instanceof MarkdownList); return (MarkdownList)list; }