I would like to get the max value out of a list using java 8 stream methods.
The structure is the following:
Use flatMap:
flatMap
int maxPrize = arrRound.stream() // Stream .flatMap(r -> r.getHits().stream()) // Stream .mapToInt(Hit::getPrizeAmount) // IntStream .max() .orElse(0);