code: public static String formatCommaSeparatedList(List<String> list) {
          StringBuilder builder = new StringBuilder();
          for (int i = 0; i < list.size(); i++) {
              if (i != 0) {
                  builder.append(",");
              }
              builder.append(list.get(i));
          }
          return builder.toString();
      }
docs: Format a comma separated list of the given list.
  
  @param list List of strings
  
  @return Comma-separated list string (e.g. "a,b,c,d")