本来是一个菜单集合,然后按父节点分组,将子节点全部合并到一个list中
List<SysMenu> menuList = new ArrayList<>(); Map<String, List<SysMenu>> menuMap = menutList.stream().collect(Collectors.toMap(SysMenu::getParentId, menuObj -> Lists.newArrayList(menuObj), (List<SysMenu> newValueList, List<SysMenu> oldValueList) -> { oldValueList.addAll(newValueList); return oldValueList; }));