Report on a multimap by producing a new map of each key mapped to the count of elements in its collection value
问题 Imagine a multimap tracking persons, each of whom has a list of assigned tasks. Map< Person , List< Task > > personToTasks = Map.of( new Person( "Alice" ) , List.of( new Task( "a1" ), new Task( "a2") ) , new Person( "Bob" ) , List.of( new Task( "b1" ) ) , new Person( "Carol" ) , List.of( new Task( "c1" ), new Task( "c2"), new Task( "c3") ) ) ; How can I use streams to get a new map, mapping each Person to an Integer with the count of items found in their list of assigned tasks? How to get a