-
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".
-
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.
-
Given a List of
People
instances (havingname
,age
andsex
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 fromfromAge
totoAge
inclusively. Example: select men who can be recruited to army (from 18 to 27 years old inclusively). -
Given a List of
People
instances (havingname
,age
andsex
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 fromfromAge
and tomaleToAge
(for men) or tofemaleToAge
(for women) inclusively. Example: select people of working age (from 18 y.o. and to 60 y.o. for men and to 55 y.o. for women inclusively). -
Given a List of
People
instances (havingname
,age
,sex
andList<Cat> cats
fields, and eachCat
having aname
andage
), return the names of all cats whose owners are women fromfemaleAge
years old inclusively. -
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. The requirements are: person should be older than 35 y, should be allowed to vote, have nationality - 'Ukrainian' and live in urk 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.
aleksandrpok / jv-stream-github-practice Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mate-academy/jv-stream-github-practice