StatefulBeanToCsv with Column headers : <p>I am using <code>opencsv-4.0</code> to write a csv file and I need to add column headers in output file.</p>

<p>Here is my code.</p>

<pre><code>public static void buildProductCsv(final List&lt;Product&gt; product,
        final String filePath) {

    try {

        Writer writer = new FileWriter(filePath);

        // mapping of columns with their positions
        ColumnPositionMappingStrategy&lt;Product&gt; mappingStrategy = new ColumnPositionMappingStrategy&lt;Product&gt;();
        // Set mappingStrategy type to Product Type
        mappingStrategy.setType(Product.class);
        // Fields in Product Bean
        String[] columns = new String[] { "productCode", "MFD", "EXD" };
        // Setting the colums for mappingStrategy
        mappingStrategy.setColumnMapping(columns);

        StatefulBeanToCsvBuilder&lt;Product&gt; builder = new StatefulBeanToCsvBuilder&lt;Product&gt;(writer);

        StatefulBeanToCsv&lt;Product&gt; beanWriter = builder.withMappingStrategy(mappingStrategy).build();
        // Writing data to csv file
        beanWriter.write(product);
        writer.close();

        log.info("Your csv file has been generated!");

    } catch (Exception ex) {
        log.warning("Exception: " + ex.getMessage());
    }

}
</code></pre>

<p>Above code create a csv file with data. But it not include column headers in that file.</p>

<p>How could I add column headers to output csv?</p>
