Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi Problem with Java task. Need to work with stream Intermediate and Terminal method and I have to finish my task I have a list

Hi

Problem with Java task. Need to work with stream Intermediate and Terminal method and I have to finish my task

I have a list of employees below and a code for generate 1000 employees, then filter the stream so that only employees with salaries lower than or equal to PLN 10,000 remain; next is increase their salary by 20%;

And now need to finish :

// - remove duplicate employees;

// - sort them according to the strategy salary descending -> last name alphabetically -> first name alphabetically

// - put them in LinkedHashSet .;

// - count them;

finish below code

List employeeList = new ArrayList<>(); for (int i = 0; i < 1000; i++) { employeeList.add(employeeGenerator.get()); } employeeList.forEach(System.out::println); employeeList.stream() .filter(e -> e.getSalary() <= 10000) .peek(e -> e.setSalary(e.getSalary() * 1.2)) .

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

Step: 3

blur-text-image

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago