```java
public static List<AttackTreeVO> getTree(List<String> names){
AttackTreeVO attackTreeVO = new AttackTreeVO();
if (names.size() == 1){
AttackTreeVO treeVO1 = new AttackTreeVO();
treeVO1.setLabel(names.get(0));
} else {
String label = names.get(0);
attackTreeVO.setLabel(label);
names.remove(0);
attackTreeVO.setCr(getTree(names));
}
return Lists.newArrayList(attackTreeVO);
}
public static void main(String[] args) {
List<AttackTreeVO> tree = getTree(Lists.newArrayList("1", "2", "3"));
System.out.println(tree);
}
最后一层的Children都是null