implement solution
Adapt code to latest JDK8 version

- use Comparator instead of Comparators
- prefer method reference in comparing and thenComparing
soluce using int stream to compute avg and sum