Skip to content

created task#1410

Open
Volodymyr8787 wants to merge 1 commit into
mate-academy:mainfrom
Volodymyr8787:jv-stream-github-practice
Open

created task#1410
Volodymyr8787 wants to merge 1 commit into
mate-academy:mainfrom
Volodymyr8787:jv-stream-github-practice

Conversation

@Volodymyr8787

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

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:

  1. 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
  2. Magic numbers and strings [CHECKLIST ITEM #7] — In CandidateValidator, extract the hardcoded values 35, 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

  1. Rate AI review example

Comment on lines +13 to +16
return candidate.getAge() >= 35
&& candidate.isAllowedToVote()
&& "Ukrainian".equals(candidate.getNationality())
&& years >= 10;

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 #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:"

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 #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.

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