Adapt code to latest JDK8 version

- use Comparator instead of Comparators
- prefer method reference in comparing and thenComparing