@Test
public void testWithHeader() throws Exception {

    final String[] header = new String[]{"one", "two", "three"};
    // withHeader() makes a copy of the header array.
    final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
    assertArrayEquals(header, formatWithHeader.getHeader());
    assertNotSame(header, formatWithHeader.getHeader());
    header[0] = "A";
    header[1] = "B";
    header[2] = "C";
    assertFalse(Arrays.equals(formatWithHeader.getHeader(), header));
}