Calculate statistics (count, min, max, sum, average)

This is NOT the official website
of Java.
List<Integer> numbers = Arrays.asList(10, 3, 2, 5, 9, 4);[10,3,2,5,9,4]
 
IntSummaryStatistics stats = numbers.stream().mapToInt(x -> x).summaryStatistics();
 
stats.getCount();6
stats.getMin();2
stats.getMax();10
stats.getSum();33
stats.getAverage();5.5