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
ListemployeeList = 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started