From a926f6ec91592e2c87136de0aae09c18d54c19fd Mon Sep 17 00:00:00 2001 From: Oleh Ridchenko Date: Wed, 27 Nov 2024 15:27:56 +0200 Subject: [PATCH] added edits from ai --- src/main/java/practice/CandidateValidator.java | 4 ++-- src/main/java/practice/StreamPractice.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/practice/CandidateValidator.java b/src/main/java/practice/CandidateValidator.java index fed38e495..382358757 100644 --- a/src/main/java/practice/CandidateValidator.java +++ b/src/main/java/practice/CandidateValidator.java @@ -10,9 +10,9 @@ public class CandidateValidator implements Predicate { @Override public boolean test(Candidate candidate) { - int formYearInUkraine = Integer.parseInt(candidate.getPeriodsInUkr().split("-")[0]); + int fromYearInUkraine = Integer.parseInt(candidate.getPeriodsInUkr().split("-")[0]); int toYearInUkraine = Integer.parseInt(candidate.getPeriodsInUkr().split("-")[1]); - int amountOfYearInUkraine = toYearInUkraine - formYearInUkraine; + int amountOfYearInUkraine = toYearInUkraine - fromYearInUkraine; return candidate.getAge() >= VALID_AGE && candidate.isAllowedToVote() diff --git a/src/main/java/practice/StreamPractice.java b/src/main/java/practice/StreamPractice.java index 20f74a564..e7ab413b8 100644 --- a/src/main/java/practice/StreamPractice.java +++ b/src/main/java/practice/StreamPractice.java @@ -26,7 +26,7 @@ public int findMinEvenNumber(List numbers) { .boxed() .min(Comparator.naturalOrder()) .orElseThrow(() -> new RuntimeException("Can't get min value from list: " - + "< Here is our input 'numbers' >")); + + numbers)); }