mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add Stream utils
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package cn.hutool.core.stream;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class StreamUtilTest {
|
||||
|
||||
@Test
|
||||
public void ofTest(){
|
||||
final Stream<Integer> stream = StreamUtil.of(2, x -> x * 2, 4);
|
||||
final String result = stream.collect(CollectorUtil.joining(","));
|
||||
Assert.assertEquals("2,4,8,16", result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user