docs: @SuppressWarnings("static-method")
  	protected StringConcatenationClient generateCommentFunction(
  			boolean forInterface, boolean forAppender,
  			String elementAccessor, String functionName, String comment,
  			TypeReference documentationAdapterType) {
  		return new StringConcatenationClient() {
  			@Override
  			protected void appendTo(TargetStringConcatenation it) {
  				it.append("\t/** Change the documentation of the element."); //$NON-NLS-1$
  				it.newLine();
  				it.append("\t *"); //$NON-NLS-1$
  				it.newLine();
  				it.append("\t * <p>"); //$NON-NLS-1$
  				it.append(comment);
  				it.newLine();
  				it.append("\t *"); //$NON-NLS-1$
  				it.newLine();
  				it.append("\t * @param doc the documentation."); //$NON-NLS-1$
  				it.newLine();
  				it.append("\t */"); //$NON-NLS-1$
  				it.newLine();
  				it.append("\t"); //$NON-NLS-1$
  				if (!forInterface) {
  					it.append("public "); //$NON-NLS-1$
  				}
  				it.append("void "); //$NON-NLS-1$
  				it.append(functionName);
  				it.append("(String doc)"); //$NON-NLS-1$
  				if (forInterface) {
  					it.append(";"); //$NON-NLS-1$
  				} else {
  					it.append(" {"); //$NON-NLS-1$
  					it.newLine();
  					if (forAppender) {
  						it.append("\t\tthis.builder.setDocumentation(doc);"); //$NON-NLS-1$
  					} else {
  						it.append("\t\tif ("); //$NON-NLS-1$
  						it.append(Strings.class);
  						it.append(".isEmpty(doc)) {"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t"); //$NON-NLS-1$
  						it.append(elementAccessor);
  						it.append(".eAdapters().removeIf(new "); //$NON-NLS-1$
  						it.append(Predicate.class);
  						it.append("<"); //$NON-NLS-1$
  						it.append(Adapter.class);
  						it.append(">() {"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\tpublic boolean test("); //$NON-NLS-1$
  						it.append(Adapter.class);
  						it.append(" adapter) {"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\t\treturn adapter.isAdapterForType("); //$NON-NLS-1$
  						it.append(documentationAdapterType);
  						it.append(".class);"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\t}"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t});"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t} else {"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t"); //$NON-NLS-1$
  						it.append(documentationAdapterType);
  						it.append(" adapter = ("); //$NON-NLS-1$
  						it.append(documentationAdapterType);
  						it.append(") "); //$NON-NLS-1$
  						it.append(EcoreUtil.class);
  						it.append(".getExistingAdapter("); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\t\t"); //$NON-NLS-1$
  						it.append(elementAccessor);
  						it.append(", "); //$NON-NLS-1$
  						it.append(documentationAdapterType);
  						it.append(".class);"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\tif (adapter == null) {"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\tadapter = new "); //$NON-NLS-1$
  						it.append(documentationAdapterType);
  						it.append("();"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t\t"); //$NON-NLS-1$
  						it.append(elementAccessor);
  						it.append(".eAdapters().add(adapter);"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\t}"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t\tadapter.setDocumentation(doc);"); //$NON-NLS-1$
  						it.newLine();
  						it.append("\t\t}"); //$NON-NLS-1$
  					}
  					it.newLine();
  					it.append("\t}"); //$NON-NLS-1$
  				}
  				it.newLineIfNotEmpty();
  				it.newLine();
  			}
  		};
  	}