public static String wrapText(String text, int length) {
        StringBuilder result = new StringBuilder();
        boolean firstLine = true;
        for (String line : splitLines(text)) {
            if (firstLine) {