Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!