11import  org .junit .jupiter .api .Disabled ;
2+ import  org .junit .jupiter .api .DisplayName ;
23import  org .junit .jupiter .api .Test ;
34
45import  java .util .List ;
89public  class  ListOpsTest  {
910
1011    @ Test 
12+     @ DisplayName ("empty lists" )
1113    public  void  testAppendingEmptyLists () {
1214        assertThat (ListOps .append (List .of (), List .of ())).isEmpty ();
1315    }
1416
1517    @ Disabled ("Remove to run test" )
1618    @ Test 
19+     @ DisplayName ("list to empty list" )
1720    public  void  testAppendingListToEmptyList () {
1821        assertThat (ListOps .append (List .of (), List .of ('1' , '2' , '3' , '4' )))
1922                .containsExactly ('1' , '2' , '3' , '4' );
2023    }
2124
2225    @ Disabled ("Remove to run test" )
2326    @ Test 
27+     @ DisplayName ("empty list to list" )
2428    public  void  testAppendingEmptyListToList () {
2529        assertThat (ListOps .append (List .of ('1' , '2' , '3' , '4' ), List .of ()))
2630                .containsExactly ('1' , '2' , '3' , '4' );
2731    }
2832
2933    @ Disabled ("Remove to run test" )
3034    @ Test 
35+     @ DisplayName ("non-empty lists" )
3136    public  void  testAppendingNonEmptyLists () {
3237        assertThat (ListOps .append (List .of ("1" , "2" ), List .of ("2" , "3" , "4" , "5" )))
3338                .containsExactly ("1" , "2" , "2" , "3" , "4" , "5" );
3439    }
3540
3641    @ Disabled ("Remove to run test" )
3742    @ Test 
43+     @ DisplayName ("empty list" )
3844    public  void  testConcatEmptyList () {
3945        assertThat (ListOps .concat (List .of ())).isEmpty ();
4046    }
4147
4248    @ Disabled ("Remove to run test" )
4349    @ Test 
50+     @ DisplayName ("list of lists" )
4451    public  void  testConcatListOfLists () {
4552        List <List <Character >> listOfLists  = List .of (
4653                List .of ('1' , '2' ),
@@ -54,6 +61,7 @@ public void testConcatListOfLists() {
5461
5562    @ Disabled ("Remove to run test" )
5663    @ Test 
64+     @ DisplayName ("list of nested lists" )
5765    public  void  testConcatListOfNestedLists () {
5866        List <List <List <Character >>> listOfNestedLists  = List .of (
5967                List .of (
@@ -82,45 +90,52 @@ public void testConcatListOfNestedLists() {
8290
8391    @ Disabled ("Remove to run test" )
8492    @ Test 
93+     @ DisplayName ("empty list" )
8594    public  void  testFilteringEmptyList () {
8695        assertThat (ListOps .filter (List .<Integer >of (), integer  -> integer  % 2  == 1 ))
8796                .isEmpty ();
8897    }
8998
9099    @ Disabled ("Remove to run test" )
91100    @ Test 
101+     @ DisplayName ("non-empty list" )
92102    public  void  testFilteringNonEmptyList () {
93103        assertThat (ListOps .filter (List .of (1 , 2 , 3 , 5 ), integer  -> integer  % 2  == 1 ))
94104                .containsExactly (1 , 3 , 5 );
95105    }
96106
97107    @ Disabled ("Remove to run test" )
98108    @ Test 
109+     @ DisplayName ("empty list" )
99110    public  void  testSizeOfEmptyList () {
100111        assertThat (ListOps .size (List .of ())).isEqualTo (0 );
101112    }
102113
103114    @ Disabled ("Remove to run test" )
104115    @ Test 
116+     @ DisplayName ("non-empty list" )
105117    public  void  testSizeOfNonEmptyList () {
106118        assertThat (ListOps .size (List .of ("one" , "two" , "three" , "four" ))).isEqualTo (4 );
107119    }
108120
109121    @ Disabled ("Remove to run test" )
110122    @ Test 
123+     @ DisplayName ("empty list" )
111124    public  void  testTransformingEmptyList () {
112125        assertThat (ListOps .map (List .<Integer >of (), integer  -> integer  + 1 )).isEmpty ();
113126    }
114127
115128    @ Disabled ("Remove to run test" )
116129    @ Test 
130+     @ DisplayName ("non-empty list" )
117131    public  void  testTransformingNonEmptyList () {
118132        assertThat (ListOps .map (List .of (1 , 3 , 5 , 7 ), integer  -> integer  + 1 ))
119133                .containsExactly (2 , 4 , 6 , 8 );
120134    }
121135
122136    @ Disabled ("Remove to run test" )
123137    @ Test 
138+     @ DisplayName ("empty list" )
124139    public  void  testFoldLeftEmptyList () {
125140        assertThat (
126141                ListOps .foldLeft (
@@ -132,6 +147,7 @@ public void testFoldLeftEmptyList() {
132147
133148    @ Disabled ("Remove to run test" )
134149    @ Test 
150+     @ DisplayName ("direction independent function applied to non-empty list" )
135151    public  void  testFoldLeftDirectionIndependentFunctionAppliedToNonEmptyList () {
136152        assertThat (
137153                ListOps .foldLeft (
@@ -143,6 +159,7 @@ public void testFoldLeftDirectionIndependentFunctionAppliedToNonEmptyList() {
143159
144160    @ Disabled ("Remove to run test" )
145161    @ Test 
162+     @ DisplayName ("direction dependent function applied to non-empty list" )
146163    public  void  testFoldLeftDirectionDependentFunctionAppliedToNonEmptyList () {
147164        assertThat (
148165                ListOps .foldLeft (
@@ -154,6 +171,7 @@ public void testFoldLeftDirectionDependentFunctionAppliedToNonEmptyList() {
154171
155172    @ Disabled ("Remove to run test" )
156173    @ Test 
174+     @ DisplayName ("empty list" )
157175    public  void  testFoldRightEmptyList () {
158176        assertThat (
159177                ListOps .foldRight (
@@ -165,6 +183,7 @@ public void testFoldRightEmptyList() {
165183
166184    @ Disabled ("Remove to run test" )
167185    @ Test 
186+     @ DisplayName ("direction independent function applied to non-empty list" )
168187    public  void  testFoldRightDirectionIndependentFunctionAppliedToNonEmptyList () {
169188        assertThat (
170189                ListOps .foldRight (
@@ -176,6 +195,7 @@ public void testFoldRightDirectionIndependentFunctionAppliedToNonEmptyList() {
176195
177196    @ Disabled ("Remove to run test" )
178197    @ Test 
198+     @ DisplayName ("direction dependent function applied to non-empty list" )
179199    public  void  testFoldRightDirectionDependentFunctionAppliedToNonEmptyList () {
180200        assertThat (
181201                ListOps .foldRight (
@@ -187,19 +207,22 @@ public void testFoldRightDirectionDependentFunctionAppliedToNonEmptyList() {
187207
188208    @ Disabled ("Remove to run test" )
189209    @ Test 
210+     @ DisplayName ("empty list" )
190211    public  void  testReversingEmptyList () {
191212        assertThat (ListOps .reverse (List .of ())).isEmpty ();
192213    }
193214
194215    @ Disabled ("Remove to run test" )
195216    @ Test 
217+     @ DisplayName ("non-empty list" )
196218    public  void  testReversingNonEmptyList () {
197219        assertThat (ListOps .reverse (List .of ('1' , '3' , '5' , '7' )))
198220                .containsExactly ('7' , '5' , '3' , '1' );
199221    }
200222
201223    @ Disabled ("Remove to run test" )
202224    @ Test 
225+     @ DisplayName ("list of lists is not flattened" )
203226    public  void  testReversingListOfListIsNotFlattened () {
204227        List <List <Character >> listOfLists  = List .of (
205228                List .of ('1' , '2' ),
0 commit comments