From c115d4e9f2b3e174f29ce29a317f4dd32ac8776b Mon Sep 17 00:00:00 2001 From: Bohdan Chupika Date: Thu, 12 Oct 2023 18:12:34 +0300 Subject: [PATCH] update checklist.md reference (#900) * update checklist.md reference * Update pom.xml --- README.md | 26 +++++++++++++------------- pom.xml | 3 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 96f06157f..eace6942b 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # Stream practice -1. Given list of strings where each element contains 1+ numbers: - input = {"5,30,100", "0, 22, 7", ...} - return min integer value. One more thing - we're interested in even numbers. - If there is no needed data throw RuntimeException with message "Can't get min value from list: method_input_list". +1. Given the list of strings where each element contains 1+ numbers: + ```input = {"5,30,100", "0, 22, 7", ...}``` + return a min integer value. One more thing - we're interested in even numbers. + If there is no needed data throw `RuntimeException` with the message "Can't get min value from list: method_input_list". 2. Given a List of Integer numbers, subtract 1 from each element on an odd position (having the odd index). Then return the average of all odd numbers or throw NoSuchElementException. -3. Given a List of `People` instances (having `name`, `age` and `sex` fields), +3. Given a List of `People` instances (having `name`, `age`, and `sex` fields), for example, `Arrays.asList( new People(«Victor», 16, Sex.MAN), new People(«Helen», 42, Sex.WOMEN))`, select from the List only men whose age is from `fromAge` to `toAge` inclusively. - Example: select men who can be recruited to army (from 18 to 27 years old inclusively). + Example: select men who can be recruited to the army (from 18 to 27 years old inclusively). -4. Given a List of `People` instances (having `name`, `age` and `sex` fields), +4. Given a List of `People` instances (having `name`, `age`, and `sex` fields), for example, `Arrays.asList( new People(«Victor», 16, Sex.MAN), new People(«Helen», 42, Sex.WOMEN))`, select from the List only people whose age is from `fromAge` and to `maleToAge` (for men) or to `femaleToAge` (for women) inclusively. @@ -25,11 +25,11 @@ and each `Cat` having a `name` and `age`), return the names of all cats whose owners are women from `femaleAge` years old inclusively. -6. Your help with a election is needed. Given list of candidates, where each element has Candidate.class type. - Check which candidates are eligible to apply for president position and return their names sorted alphabetically. +6. Your help with an election is needed. Given a list of candidates, where each element has Candidate.class type. + Check which candidates are eligible to apply for the president position and return their names sorted alphabetically. The requirements are: person should be at least 35 years old, should be allowed to vote, have nationality - 'Ukrainian' - and live in Ukraine for 10 years. For the last requirement use field periodsInUkr, which has following view: - "2002-2015" For now we don't care if that was last 10 or not. We want to reuse our validation in future, so - let's write our own impl of Predicate in CandidateValidator. + and lived in Ukraine for 10 years. For the last requirement use the field periodsInUkr, which has the following view: + "2002-2015" For now we don't care if that was the last 10 or not. We want to reuse our validation in the future, so + let's write our own implementation of Predicate in CandidateValidator. -[Try to avoid these common mistakes while solving task](https://mate-academy.github.io/jv-program-common-mistakes/java-core/java-eight-part-two/stream-api) +[Try to avoid these common mistakes while solving task](./checklist.md) diff --git a/pom.xml b/pom.xml index fa72c5809..440568c72 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,6 @@ 17 UTF-8 UTF-8 - 3.1.1 https://raw.githubusercontent.com/mate-academy/style-guides/master/java/checkstyle.xml @@ -31,7 +30,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.1 + 3.3.0 compile