created task#1410
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution correctly implements all 6 tasks using Stream API with proper logic and enum comparison via equals(). The core functionality is sound and meets the task requirements.
Two minor checklist violations were identified that should be addressed before final submission:
-
Missing space in exception message [CHECKLIST ITEM #6] — In
findMinEvenNumber(), the error message should have a space after the colon:// Current (incorrect): "Can't get min value from list:" + numbers // Should be: "Can't get min value from list: " + numbers
-
Magic numbers and strings [CHECKLIST ITEM #7] — In
CandidateValidator, extract the hardcoded values35,10, and"Ukrainian"as named constants to improve readability and maintainability.
These are style and best-practice issues rather than functional blockers—your code works correctly, but aligning with the checklist standards will strengthen the submission.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| return candidate.getAge() >= 35 | ||
| && candidate.isAllowedToVote() | ||
| && "Ukrainian".equals(candidate.getNationality()) | ||
| && years >= 10; |
There was a problem hiding this comment.
Checklist item #7 violation: Magic numbers and strings should be extracted as constants. The age threshold (35), nationality ('Ukrainian'), and years requirement (10) are used directly in the code.
| .mapToInt(Integer::parseInt) | ||
| .filter(n -> n % 2 == 0) | ||
| .min() | ||
| .orElseThrow(() -> new RuntimeException("Can't get min value from list:" |
There was a problem hiding this comment.
Checklist item #6 violation: The exception message should have a space after the colon: "Can't get min value from list: " + numbers. Current code concatenates directly without the space.
No description provided.