String (String packageInfoText) { final StringBuilder commentText = new StringBuilder("/**\n"); final String[] lines = StringUtil.splitByLines(packageInfoText); boolean appended = false; for (String line : lines) { if (!appended && line.isEmpty()) { // skip empty lines at the beginning continue; } commentText.append(" * ").append(line).append('\n'); appended = true; } commentText.append("*/"); return commentText.toString(); }