From ee5157c470dbb7ea52a8ffe3cc58e68f3f0349e2 Mon Sep 17 00:00:00 2001 From: guozhiqi Date: Mon, 21 Aug 2023 09:17:55 +0800 Subject: [PATCH] =?UTF-8?q?Stream=20=E6=B5=81=E5=A2=9E=E5=8A=A0test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edp/web/common/stream/StreamTest.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 web-common/src/test/java/com/inspur/edp/web/common/stream/StreamTest.java diff --git a/web-common/src/test/java/com/inspur/edp/web/common/stream/StreamTest.java b/web-common/src/test/java/com/inspur/edp/web/common/stream/StreamTest.java new file mode 100644 index 00000000..9d541989 --- /dev/null +++ b/web-common/src/test/java/com/inspur/edp/web/common/stream/StreamTest.java @@ -0,0 +1,35 @@ +package com.inspur.edp.web.common.stream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author noah + * 2023/8/18 15:17 + */ +public class StreamTest { + private List stringList; + + @BeforeEach + public void init() { + stringList = new ArrayList<>(); + for (int i = 0; i <= 10; i++) { + stringList.add(String.valueOf(i)); + } + } + + @Test + public void test() { + System.out.println(stringList.size()); + this.stringList.stream().peek(t -> { + System.out.println(t); + }); + + } + + +} -- Gitee