I would like to get the max value out of a list using java 8 stream methods.
The structure is the following:
using Comparator:
Comparator
int max2 = arrRound.stream() .flatMap(round -> round.getHits().stream()) .max(Comparator.comparing(Hits::getPrizeAmount)) .map(Hits::getPrizeAmount) .orElse(-1);