void print(List<Line> lines, AnsiEscapes... border) {
        int maxLength = lines.stream().map(Line::length).max(comparingInt(a -> a))
                .orElseThrow(NoSuchElementException::new);

        StringBuilder out = new StringBuilder();

        Format borderFormat = monochrome ? monochrome() : color(border);

        out.append(borderFormat.text("┌" + times('─', maxLength + 2) + "┐")).append("\n");
        for (Line line : lines) {
            int rightPad = maxLength - line.length();
            out.append(borderFormat.text("│"))
                    .append(' ');

            for (Span span : line.spans) {
                Format format = monochrome ? monochrome() : color(span.escapes);
                out.append(format.text(span.text));
            }

            out.append(times(' ', rightPad))
                    .append(' ')
                    .append(borderFormat.text("│"))
                    .append("\n");

        }
        out.append(borderFormat.text("└" + times('─', maxLength + 2) + "┘")).append("\n");
        this.out.print(out);
    }
@Test
    void printsAnsiBanner() throws UnsupportedEncodingException {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        Banner banner = new Banner(new PrintStream(bytes, false, StandardCharsets.UTF_8.name()), false);

        banner.print(asList(
            new Banner.Line("Bla"),
            new Banner.Line(
                new Banner.Span("Bla "),
                new Banner.Span("Bla", AnsiEscapes.BLUE),
                new Banner.Span(" "),
                new Banner.Span("Bla", AnsiEscapes.RED)),
            new Banner.Line("Bla Bla")), AnsiEscapes.CYAN);

        assertThat(bytes, bytes(equalTo("" +
                "\u001B[36m┌─────────────┐\u001B[0m\n" +
                "\u001B[36m│\u001B[0m Bla         \u001B[36m│\u001B[0m\n" +
                "\u001B[36m│\u001B[0m Bla \u001B[34mBla\u001B[0m \u001B[31mBla\u001B[0m \u001B[36m│\u001B[0m\n" +
                "\u001B[36m│\u001B[0m Bla Bla     \u001B[36m│\u001B[0m\n" +
                "\u001B[36m└─────────────┘\u001B[0m\n")));
    }