code: private void validateCsvFile(List<String[]> content, String fileName) {
      if (content.isEmpty()) {
        throw new MolgenisDataException(format("CSV-file: [{0}] is empty", fileName));
      }
  
      if (content.size() == 1) {
        throw new MolgenisDataException(
            format("Header was found, but no data is present in file [{0}]", fileName));
      }
  
      int headerLength = content.get(0).length;
      content.forEach(
          row -> {
            if (row.length != headerLength) {
              throw new MolgenisDataException(
                  format("Column count in CSV-file: [{0}] is not consistent", fileName));
            }
          });
    }
docs: Validates CSV file content.
  
  <p>Checks that the content is not empty. Checks that at least one data row is present. Checks
  that data row lengths are consistent with the header row length.
  
  @param content content of CSV-file
  @param fileName the name of the file that is validated
  @throws MolgenisDataException if the validation fails