All methods below should be implemented in CollectionService
class.
To complete tasks use Stream API methods.
Implement the method public List<Integer> filterEvenNumbers(List<Integer> list)
.
It must filter list and return only even numbers. To complete the task use filter(...)
method in Stream API.
Implement the method public List<String> toUpperCaseCollection(List<String> list)
.
It must modify a list and return all values in upper case. To complete the task use map(...)
method in Stream API.
Implement the method public Optional<Integer> findMax(List<Integer> list)
.
It must find max number in the list. To complete the task use max(...)
method in Stream API.
Implement the method public Optional<Integer> findMin(List<List<Integer>> list)
.
It must find min value among all lists. To complete the task use flatMap(...)
and min(...)
methods in Stream API.
Implement the method public Integer sum(List<Integer> list)
.
It must calculate a sum of all elements in the list. To complete the task use reduce(...)
method in Stream API.