List<User> userList=new ArrayList<>(); //把实体里面的Id单独抽取出来 Map<Integer, User> userInfoMap= userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
List<User> userList=new ArrayList<>(); //把实体里面的Id单独抽取出来 Map<Integer, User> userInfoMap= userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));