补充方法,并为部分工厂方法添加空值处理

This commit is contained in:
huangchengxing
2022-08-22 11:00:42 +08:00
parent d567efde00
commit 227313c632
2 changed files with 58 additions and 35 deletions

View File

@@ -427,4 +427,13 @@ public class EasyStreamTest {
Assert.assertTrue(EasyStream.of(1).isNotEmpty());
}
@Test
public void testTransform() {
boolean result = EasyStream.of(1, 2, 3)
.transform(EasyStream::toList)
.map(List::isEmpty)
.orElse(false);
Assert.assertFalse(result);
}
}