@Test
public void testGetHeader() throws Exception {

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