Question: In java 8 please. Thank You. Task 4 The system you work with on a daily basis runs multiple microservices. You have been asked to

In java 8 please. Thank You.
Task 4 The system you work with on a daily basis runs multiple microservices. You have been asked to prepare an aggregation that represents the number of user visits to all microservices, for use by data analysts. The architect you're working with has already designed the API, which consists of a single class: Visitcounter. Visitcounter has a single method, count. It returns Map - this map should contain the number of visits by the user with a given ID. This method accepts an array of Map. Every map represents the total number of visits per user to a given microservice. There are some problems, however: - The map key, which is a string, should be parseable to Long - but it may not be. You must skip any such faulty entries. (O) ) - For some keys, UserStats may be nu11. You must skip any such faulty entries. (O) - Userstats has a single field, visitCount, of type optional. A getter for this field is also implemented. This field will never be nu1l; however, it might be empty. You must skip any such faulty entries. (0) Remember that you may receive some invalid input: nu11, empty maps, and so on. Handle it all appropriately and return an empty map. You may use Java 8 Streams API to implement your solution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
