code: private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
          Iterator it = collection.iterator();
          boolean hasNext = it.hasNext();
          //boolean areColumns = (columns == collection);
  
          while (hasNext) {
              Outputable sqlToken = (Outputable) it.next();
              hasNext = it.hasNext();
              sqlToken.write(out);
              if (areColumns) {
                  Column column = (Column) sqlToken;
                  String columnAlias = column.getAlias();
                  if (columnAlias != null) {
                      out.print(" AS ");
                      out.print("\"");
                      out.print(columnAlias);
                      out.print("\"");
                  }
              }
              if (hasNext) {
                  out.print(separator);
                  out.println();
              }
          }
      }
docs: Iterate through a Collection and append all entries (using .toString()) to
  a StringBuffer.