Skip to content

Lesson 58 (collection lambda param)#104

Open
Binary-Cat-01 wants to merge 3 commits intoKFalcon2022:for-prfrom
Binary-Cat-01:lesson_58_collection_lambda_param
Open

Lesson 58 (collection lambda param)#104
Binary-Cat-01 wants to merge 3 commits intoKFalcon2022:for-prfrom
Binary-Cat-01:lesson_58_collection_lambda_param

Conversation

@Binary-Cat-01
Copy link
Copy Markdown

No description provided.

Map<String, Employee> employeeMap = new HashMap<>();

employees.forEach(
e -> employeeMap.merge(e.getName(), e, (oldE, newE) -> oldE.getAge() < newE.getAge() ? newE : oldE));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как будто через compute() проще

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants