1、List<Integer>转换成一个使用逗号隔开的字符串
String str = list.stream() .map(Objects::toString) .collect(Collectors.joining(","));
2、将上面的字符串再转换回去
List<Integer> list = Arrays.stream(houseId.split(",")).map(Integer::parseInt) .collect(Collectors.toList());
将list重新根据某个字段排序:
List<DataBean> list = list.stream().sorted(Comparator.comparing(DataBean::getStort)).collect(Collectors.toList());