2121import static org .apache .commons .csv .Constants .CR ;
2222import static org .apache .commons .csv .Constants .CRLF ;
2323import static org .apache .commons .csv .Constants .LF ;
24-
2524import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
2625import static org .junit .jupiter .api .Assertions .assertEquals ;
2726import static org .junit .jupiter .api .Assertions .assertFalse ;
3433
3534import java .io .ByteArrayInputStream ;
3635import java .io .ByteArrayOutputStream ;
36+ import java .io .IOException ;
3737import java .io .ObjectInputStream ;
3838import java .io .ObjectOutputStream ;
3939import java .io .Reader ;
40- import java .io .IOException ;
4140import java .io .StringReader ;
4241import java .lang .reflect .Method ;
4342import java .lang .reflect .Modifier ;
@@ -175,7 +174,7 @@ public void testEqualsHash() throws Exception {
175174 assertNotEquals (name , type , a , b );
176175 } else if ("java.lang.Character" .equals (type )){
177176 final Object a = method .invoke (CSVFormat .DEFAULT , new Object [] {null });
178- final Object b = method .invoke (CSVFormat .DEFAULT , new Character ('d' ));
177+ final Object b = method .invoke (CSVFormat .DEFAULT , Character . valueOf ('d' ));
179178 assertNotEquals (name , type , a , b );
180179 } else if ("java.lang.String" .equals (type )){
181180 final Object a = method .invoke (CSVFormat .DEFAULT , new Object [] {null });
@@ -538,7 +537,7 @@ public void testEscapeSameAsCommentStartThrowsExceptionForWrapperType() {
538537 // Cannot assume that callers won't use different Character objects
539538 assertThrows (
540539 IllegalArgumentException .class ,
541- () -> CSVFormat .DEFAULT .withEscape (Character .valueOf ('!' )).withCommentMarker (new Character ('!' )));
540+ () -> CSVFormat .DEFAULT .withEscape (Character .valueOf ('!' )).withCommentMarker (Character . valueOf ('!' )));
542541 }
543542
544543 @ Test
@@ -561,7 +560,7 @@ public void testFormatThrowsNullPointerException() {
561560
562561 @ Test
563562 public void testGetHeader () {
564- final String [] header = new String [] {"one" , "two" , "three" };
563+ final String [] header = {"one" , "two" , "three" };
565564 final CSVFormat formatWithHeader = CSVFormat .DEFAULT .withHeader (header );
566565 // getHeader() makes a copy of the header array.
567566 final String [] headerCopy = formatWithHeader .getHeader ();
@@ -940,7 +939,7 @@ public void testWithFirstRecordAsHeader() {
940939
941940 @ Test
942941 public void testWithHeader () {
943- final String [] header = new String [] {"one" , "two" , "three" };
942+ final String [] header = {"one" , "two" , "three" };
944943 // withHeader() makes a copy of the header array.
945944 final CSVFormat formatWithHeader = CSVFormat .DEFAULT .withHeader (header );
946945 assertArrayEquals (header , formatWithHeader .getHeader ());
0 commit comments