+ * Editing the list does not update this instance. + *
* * @return a new List * @since 1.9.0 */ public List+ * Editing the map does not update this instance. + *
* * @return A new Map. The map is empty if the record has no headers. */ diff --git a/src/test/java/org/apache/commons/csv/CSVRecordTest.java b/src/test/java/org/apache/commons/csv/CSVRecordTest.java index 042677f1..9cb7f31e 100644 --- a/src/test/java/org/apache/commons/csv/CSVRecordTest.java +++ b/src/test/java/org/apache/commons/csv/CSVRecordTest.java @@ -16,6 +16,7 @@ */ package org.apache.commons.csv; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -30,6 +31,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.StringReader; import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; @@ -47,9 +49,7 @@ public class CSVRecordTest { /** This enum overrides toString() but it's the names that matter. */ public enum EnumHeader { - FIRST("first"), - SECOND("second"), - THIRD("third"); + FIRST("first"), SECOND("second"), THIRD("third"); private final String number; @@ -69,7 +69,7 @@ public class CSVRecordTest { @BeforeEach public void setUp() throws Exception { - values = new String[] {"A", "B", "C"}; + values = new String[] { "A", "B", "C" }; final String rowData = StringUtils.join(values, ','); try (final CSVParser parser = CSVFormat.DEFAULT.parse(new StringReader(rowData))) { record = parser.iterator().next(); @@ -273,7 +273,17 @@ public class CSVRecordTest { } @Test - public void testToList() { + public void testToListAdd() { + String[] expected = values.clone(); + final List