Skip to content

Conversation

@jinstrm
Copy link

@jinstrm jinstrm commented Apr 11, 2017

No description provided.

private boolean hasExperienceInEpam(Employee employee){
return employee.getJobHistory().stream()
.filter(j -> j.getEmployer().equals("epam"))
.count() > 0;

Choose a reason for hiding this comment

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

Use anyMatch instead.

return employee.getJobHistory().stream()
.limit(1)
.filter(j -> j.getEmployer().equals("epam"))
.count() > 0;

Choose a reason for hiding this comment

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

anyMatch

throw new UnsupportedOperationException();
return (mp, p) -> {
mp.getKeyById().put(p.getKey().getId(), p.getKey());
if (!mp.getValueById().containsKey(p.getValue().getKeyId()))

Choose a reason for hiding this comment

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

Use computeIfAbsent

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