code: public static void writeCsv(List<String[]> csvData, String fileName) throws IOException {
      Preconditions.checkNotNull(csvData, "Null CSV data");
      Preconditions.checkNotNull(fileName, "Null file name");
  
      CSVWriter writer = null;
      try {
        writer = new CSVWriter(Files.newWriter(new File(fileName), StandardCharsets.UTF_8));
        for (String[] line : csvData) {
          writer.writeNext(line);
        }
      } finally {
        if (writer != null) {
          writer.close();
        }
      }
    }
docs: Writes the CSV data located in {@code csvData} to the file located at
  {@code fileName}.
  
  @param csvData the CSV data including the header
  @param fileName the file to write the CSV data to
  @throws IOException if there was an error writing to the file
  @throws NullPointerException if {@code csvData == null} or {@code fileName == null}