:trollface: 优化EasyStream中toTree对predicate的处理,过滤掉id为null的元素,避免StackOverflow

This commit is contained in:
VampireAchao
2022-10-07 11:53:31 +08:00
parent 2c2ad12972
commit c1acb2e148
3 changed files with 14 additions and 21 deletions

View File

@@ -434,6 +434,8 @@ public class EasyStreamTest {
Consumer<Object> test = o -> {
final List<Student> studentTree = EasyStream
.of(
// 会过滤掉id为null的元素
Student.builder().name("top").build(),
Student.builder().id(1L).name("dromara").build(),
Student.builder().id(2L).name("baomidou").build(),
Student.builder().id(3L).name("hutool").parentId(1L).build(),