11package it .aboutbits .springboot .toolbox .util ;
22
33import org .jspecify .annotations .NullMarked ;
4- import org .jspecify .annotations .Nullable ;
54import org .junit .jupiter .api .DisplayName ;
65import org .junit .jupiter .api .Nested ;
76import org .junit .jupiter .api .Test ;
@@ -381,7 +380,7 @@ class CollectToMap {
381380 @ DisplayName ("Should convert Collection to Map using key and value mappers" )
382381 void shouldConvertCollectionToMapUsingMappers () {
383382 // given
384- var items = (Collection <@ Nullable String >) Arrays .asList ("a" , "bb" , "ccc" );
383+ var items = (Collection <String >) Arrays .asList ("a" , "bb" , "ccc" );
385384
386385 // when
387386 var result = CollectUtil .collectToMap (items , String ::length , Function .identity ());
@@ -398,7 +397,7 @@ void shouldConvertCollectionToMapUsingMappers() {
398397 @ DisplayName ("Should throw on duplicate keys according to Collectors.toMap default behavior" )
399398 void shouldThrowOnDuplicateKeys () {
400399 // given
401- var items = (Collection <@ Nullable String >) Arrays .asList ("a" , "b" ); // both have length of 1
400+ var items = (Collection <String >) Arrays .asList ("a" , "b" ); // both have length of 1
402401
403402 // when / then
404403 assertThatIllegalStateException ().isThrownBy (
@@ -431,7 +430,7 @@ void shouldConvertStreamableToMapUsingMappers() {
431430 @ DisplayName ("Should convert Stream to Map using key and value mappers" )
432431 void shouldConvertStreamToMapUsingMappers () {
433432 // given
434- var items = Stream .< @ Nullable String > of ("m" , "nn" );
433+ var items = Stream .of ("m" , "nn" );
435434
436435 // when
437436 var result = CollectUtil .collectToMap (items , String ::length , Function .identity ());
@@ -447,7 +446,7 @@ void shouldConvertStreamToMapUsingMappers() {
447446 @ DisplayName ("Should return empty map for empty collection" )
448447 void shouldReturnEmptyMapForEmptyCollection () {
449448 // given
450- var items = Collections .<@ Nullable String >emptyList ();
449+ var items = Collections .<String >emptyList ();
451450
452451 // when
453452 var result = CollectUtil .collectToMap (items , String ::length , Function .identity ());
@@ -473,7 +472,7 @@ void shouldReturnEmptyMapForEmptyStreamable() {
473472 @ DisplayName ("Should return empty map for empty stream" )
474473 void shouldReturnEmptyMapForEmptyStream () {
475474 // given
476- var items = Stream .<@ Nullable String >empty ();
475+ var items = Stream .<String >empty ();
477476
478477 // when
479478 var result = CollectUtil .collectToMap (items , String ::length , Function .identity ());
0 commit comments