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.lang.tree;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -109,12 +110,12 @@ public class TreeTest {
|
||||
// 经过过滤,生成新的树
|
||||
Tree<String> newTree = tree.filterNew((t)->{
|
||||
final CharSequence name = t.getName();
|
||||
return null != name && name.toString().contains("管理");
|
||||
return null != name && name.toString().contains("店铺");
|
||||
});
|
||||
|
||||
List<String> ids = new ArrayList<>();
|
||||
newTree.walk((tr)-> ids.add(tr.getId()));
|
||||
Assert .assertEquals(6, ids.size());
|
||||
Assert .assertEquals(4, ids.size());
|
||||
|
||||
List<String> ids2 = new ArrayList<>();
|
||||
tree.walk((tr)-> ids2.add(tr.getId()));
|
||||
|
Reference in New Issue
Block a user