Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final int[] count = {0};
- users
- .entrySet()
- .stream()
- .sorted((a,b) -> {
- if(b.getValue()- a.getValue() != 0){
- return b.getValue()-a.getValue();
- }
- return a.getKey().compareTo(b.getKey());
- })
- .forEach(k-> {
- count[0] += 1;
- System.out.printf("%d. %s -> %d%n", count[0],k.getKey(),k.getValue());
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement