This commit is contained in:
Looly
2022-11-27 16:04:17 +08:00
parent 3b3498c8a1
commit 738519d6db
2 changed files with 21 additions and 3 deletions

View File

@@ -181,7 +181,9 @@ public class EasyStreamTest {
final List<Integer> distinctBy2 = EasyStream.of(list).parallel().distinct(String::valueOf).toList();
Assert.assertEquals(collect1, distinctBy1);
Assert.assertEquals(collect2, distinctBy2);
// 并行流测试
Assert.assertEquals(ListUtil.sort(collect2), ListUtil.sort(distinctBy2));
Assert.assertEquals(
4, EasyStream.of(1, 2, 2, null, 3, null).parallel(true).distinct(t -> Objects.isNull(t) ? null : t.toString()).sequential().count()