private static void wrap(String line, int width, String indent,
                StringBuilder sb) {
            if (line.length() <= width) {
                // no wrapping
                sb.append(line).append('\n');
                return;
            }
            boolean first = true;
            int start = 0;

            for (int end = width; end > start; end--) {
                if (line.charAt(end) == ' ') {
                    // split
                    if (first) first = false;
                    else sb.append(indent);
                    sb.append(line.substring(start, end)).append('\n');
                    start = end + 1;
                    end += width;
                    if (end >= line.length()) {
                        sb.append(indent);
                        sb.append(line.substring(start)).append('\n');
                        break;
                    }
                }
            }
        }