使用stream实现根据id和时间最晚分组获取map
Map<String, Attendance> collect = list.parallelStream().collect(Collectors.groupingBy(Attendance::getTokenid, Collectors.collectingAndThen( Collectors.reducing((a, b) -> a.getOpendate().getTime() > b.getOpendate().getTime() ? a : b), Optional::get)));
其中,Attendance是实体类,其两个字段分别是tokenId和openDate;