直接替换
List<String> contextList = new ArrayList<>();
contextList.add("11");
contextList.add("22");
contextList.add("33");
List<String> collect = contextList.stream().map(str -> "aa").toList();
collect.forEach(System.out::println);
比较修改
List<String> contextList = new ArrayList<>();
contextList.add("11");
contextList.add("22");
contextList.add("33");
List<String> collect = contextList.stream().map(str -> StringUtils.isEmpty(str) ? "" : str + "2").toList();
collect.forEach(System.out::println);