code: public static String arrayListToCSV(List<String> list) {
          StringBuilder csv = new StringBuilder();
          for (String str : list) {
              csv.append(str);
              csv.append(",");
          }
          int lastIndex = csv.length() - 1;
          char last = csv.charAt(lastIndex);
          if (last == ',') {
              return csv.substring(0, lastIndex);
          }
          return csv.toString();
      }
docs: Converts String ArrayList to CSV string
  @param list List of String to create a CSV string
  @return CSV string