docs: @VisibleForTesting
    static void appendJavadoc(
        IndentedLinesBuilder ilb, String doc, boolean forceMultiline, boolean wrapAt100Chars) {
  
      if (wrapAt100Chars) {
        // Actual wrap length is less because of indent and because of space used by Javadoc chars.
        int wrapLen = 100 - ilb.getCurrIndentLen() - 7;
        List<String> wrappedLines = Lists.newArrayList();
        for (String line : Splitter.on('\n').split(doc)) {
          while (line.length() > wrapLen) {
            int spaceIndex = line.lastIndexOf(' ', wrapLen);
            if (spaceIndex >= 0) {
              wrappedLines.add(line.substring(0, spaceIndex));
              line = line.substring(spaceIndex + 1); // add 1 to skip the space
            } else {
              // No spaces. Just wrap at wrapLen.
              wrappedLines.add(line.substring(0, wrapLen));
              line = line.substring(wrapLen);
            }
          }
          wrappedLines.add(line);
        }
        doc = Joiner.on("\n").join(wrappedLines);
      }
  
      if (doc.contains("\n") || forceMultiline) {
        // Multiline.
        ilb.appendLine("/**");
        for (String line : Splitter.on('\n').split(doc)) {
          ilb.appendLine(" * ", line);
        }
        ilb.appendLine(" */");
  
      } else {
        // One line.
        ilb.appendLine("/** ", doc, " */");
      }
    }