Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using java 4) Person class has the following properties:- Person(Integer id, String name, Float salary) Create a PersonService class:- a) List generateList() - This method

using java

4) Person class has the following properties:-

Person(Integer id, String name, Float salary) Create a PersonService class:- a) List generateList() - This method should create a list of Person objects. Use any arbitrary data.

b) Map transform(List people) - This method takes as input the List in the previous step and converts it to a Map. The key (integer) should be the Person.id. If two or more Person objects in the List has duplicate ids, then before Inserting in the Map, then append one on the decimal side. e.g. PersonA - 1, ankur, 20000 : Map<1, Person(1, ankur, 20000)> PersonB - 1, ravi, 30000 : Map<1.1, Person<1, ravi, 30000)> PersonC - 1, prem, 50000: Map<1.11, Person,1,50000>

c) show(List) - prints the Person list on the console in readable format.

d) show(Map - prints the Person map on the console in readable format.

e) Write JUnit tests. Coverage should be atleast 70%.


Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Explain the forces that influence how people handle conflict

Answered: 1 week ago