Integer[] rank = {1}; entry.getValue().stream().peek(ro->ro.setRank(rank[0]++)).collect(Collectors.toList())