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)); }