mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add method
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -66,4 +67,13 @@ public class TreeTest {
|
||||
|
||||
Assert.assertEquals(treeNodes.size(), 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void walkTest(){
|
||||
List<String> ids = new ArrayList<>();
|
||||
final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
|
||||
tree.walk((tr)-> ids.add(tr.getId()));
|
||||
|
||||
Assert .assertEquals(7, ids.size());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user