mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.hutool.core.tree;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -77,6 +78,17 @@ public class TreeTest {
|
||||
Assert .assertEquals(7, ids.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void walkBroadFirstTest(){
|
||||
final List<String> ids = new ArrayList<>();
|
||||
final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
|
||||
Console.log(tree);
|
||||
tree.walk((tr)-> ids.add(tr.getId()), true);
|
||||
|
||||
Console.log(ids);
|
||||
Assert .assertEquals(7, ids.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cloneTreeTest(){
|
||||
final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
|
||||
|
Reference in New Issue
Block a user