Skip to content

Commit

Permalink
update checklist.md reference (#900)
Browse files Browse the repository at this point in the history
* update checklist.md reference

* Update pom.xml
  • Loading branch information
boroda4436 authored Oct 12, 2023
1 parent a6777f9 commit c115d4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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<Candidate> 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<Candidate> 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)
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<jdk.version>17</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.checkstyle.plugin.version>3.1.1</maven.checkstyle.plugin.version>
<maven.checkstyle.plugin.configLocation>
https://raw.githubusercontent.com/mate-academy/style-guides/master/java/checkstyle.xml
</maven.checkstyle.plugin.configLocation>
Expand All @@ -31,7 +30,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>compile</phase>
Expand Down

0 comments on commit c115d4e

Please sign in to comment.