private void setGroupIdMap(Model model, List<NodeGroupPo> nodeGroups, List<NodeInfo> nodeInfos) {
        Map<String, Set<String>> groupIdMap = new HashMap<String, Set<String>>();
        if (CollectionUtils.isNotEmpty(nodeGroups)) {

            for (NodeGroupPo nodeGroup : nodeGroups) {
                groupIdMap.put(nodeGroup.getName(), new HashSet<String>());
            }

            if (CollectionUtils.isNotEmpty(nodeInfos)) {
                for (NodeInfo nodeInfo : nodeInfos) {
                    Set<String> identities = groupIdMap.get(nodeInfo.getNodeGroup());
                    if (identities == null) {
                        identities = new HashSet<String>();
                        groupIdMap.put(nodeInfo.getNodeGroup(), identities);
                    }
                    identities.add(nodeInfo.getIdentity());
                }
            }
        }
        model.addAttribute("groupIdMap", JSON.toJSONString(groupIdMap));
    }
@author Robert HG (254963746@qq.com) on 8/22/15.
lts-admin/src/main/java/com/github/ltsopensource/admin/web/view/MonitorView.java