boolean (StringBuilder sb, List<? extends PsiComment> comments) { boolean newLineNeed = false; for (PsiComment element : comments) { if (newLineNeed) { sb.append('\n'); newLineNeed = false; } sb.append(" "); sb.append(element.getText()); if (element.getTokenType() == JavaTokenType.END_OF_LINE_COMMENT) { newLineNeed = true; } } return newLineNeed; }