Skip to content

done#1411

Open
acidcor wants to merge 2 commits into
mate-academy:mainfrom
acidcor:main
Open

done#1411
acidcor wants to merge 2 commits into
mate-academy:mainfrom
acidcor:main

Conversation

@acidcor

@acidcor acidcor commented May 19, 2026

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The code correctly implements all functional requirements using Stream API, and the logic for filtering, mapping, and reducing is sound. However, there is a consistent violation of the enum comparison requirement across multiple methods. The checklist explicitly states to use .equals() for Enum value comparisons instead of ==, and this applies to selectMenByAge(), getWorkablePeople(), and getCatsNames() methods where person.getSex() == Person.Sex.MAN or woman are used. Since explicit checklist items are violated, changes are needed. Replace all enum comparisons using == with .equals() method calls—for example, change person.getSex() == Person.Sex.MAN to person.getSex().equals(Person.Sex.MAN). The core functionality is working correctly, so once the enum comparisons are fixed, the implementation should be complete.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

return peopleList.stream()
.filter(person -> person.getAge() >= fromAge
&& person.getAge() <= toAge
&& person.getSex() == Person.Sex.MAN)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #X violation: Use equals() for Enum value comparisons instead of ==. The Sex enum should be compared using .equals() method.

return Collections.emptyList();
return peopleList.stream()
.filter(person -> person.getAge() >= fromAge)
.filter(person -> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #X violation: Use equals() for Enum value comparisons instead of ==. The Sex enum should be compared using .equals() method.

.filter(person -> {
if (person.getSex() == Person.Sex.WOMAN) {
return person.getAge() <= femaleToAge;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #X violation: Use equals() for Enum value comparisons instead of ==. The Sex enum should be compared using .equals() method.

public List<String> getCatsNames(List<Person> peopleList, int femaleAge) {
return Collections.emptyList();
return peopleList.stream()
.filter(person -> person.getSex() == Person.Sex.WOMAN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #X violation: Use equals() for Enum value comparisons instead of ==. The Sex enum should be compared using .equals() method.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution meets all requirements and all previously identified issues have been successfully resolved. The enum comparison violations have been fixed - all methods now correctly use ".equals()" for comparing enum values, and the constants for age thresholds and other magic values are properly defined in CandidateValidator. The Stream API is used correctly throughout all six tasks, edge cases are handled with appropriate exceptions, and all checklist items are satisfied. The implementation is clean, well-structured, and functional. Great work on addressing the feedback and getting everything working correctly!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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