从list中获取String字段并去重
List<String> name = list.stream()
.map(TEntity::getName).distinct().collect(Collectors.toList());
List<Map<String, String>>转Map<String, String>
Map<String, String> map = listMap.stream()
.collect(Collectors.toMap(s->s.get("key"), s -> s.get("value")));
List转String逗号分隔符
String newStr = permissionList.stream().collect(Collectors.joining(","));
List 过滤、排序、取前10个
List<HomeAttentionUserApiVo> ret = userApiVos.stream()
.filter(user -> user.getIsAttention() == 0)
.sorted(Comparator.comparing(HomeAttentionUserApiVo::getWorksLikeCount,
Comparator.reverseOrder())
.thenComparing(HomeAttentionUserApiVo::getWorksCount,
Comparator.reverseOrder()))
.limit(10).collect(Collectors.toList());