While working on a Hacker Rank Problem I wrote few one lines using java stream to find mean, median, mode, Q1, Q3, variance and standard deviation. Thought to share since it's quite interesting.
// mean
double mean = list.stream().mapToInt(Integer::intValue).average().getAsDouble();
System.out.println(mean);
// mode - create count map using group by and sorted with custom comparator to give minimum from competing probable mode values
Integer mode = list.stream()
.collect(Collectors.groupingBy(i -> i, () -> new TreeMap<Integer, Long>(), Collectors.counting()))