From d12411fc0593b19928cf9943074d47e180ddfafb Mon Sep 17 00:00:00 2001 From: Saravanan Date: Fri, 7 Jul 2023 12:33:41 +0100 Subject: [PATCH 1/2] Past commit --- test2.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test2.txt diff --git a/test2.txt b/test2.txt new file mode 100644 index 0000000..5852f44 --- /dev/null +++ b/test2.txt @@ -0,0 +1 @@ +Initial commit From f31261533d1b693b0544e8003ab7d4acfb1d3b72 Mon Sep 17 00:00:00 2001 From: Saravanan Date: Thu, 7 Sep 2023 12:33:41 +0100 Subject: [PATCH 2/2] Past commit --- src/com/array/rotations/PeekSample.java | 29 +++++++++++++++++++++++++ test1.txt | 1 + 2 files changed, 30 insertions(+) create mode 100644 src/com/array/rotations/PeekSample.java create mode 100644 test1.txt diff --git a/src/com/array/rotations/PeekSample.java b/src/com/array/rotations/PeekSample.java new file mode 100644 index 0000000..d017eeb --- /dev/null +++ b/src/com/array/rotations/PeekSample.java @@ -0,0 +1,29 @@ +package com.array.rotations; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class PeekSample { + + public static void main(String arg[]) { + List names = Arrays.asList("Alice", "Bob", "Charlie", "David", "Edward"); + + List upperNames = names + .stream() + .peek(n-> System.out.println("Names : "+n)) + //.map(n-> n) + .collect(Collectors.toList()); + + upperNames.stream().forEach(n -> System.out.println(n)); + + String listToString = upperNames + .stream() + //.map(n->n) + .collect(Collectors.joining(", ", "[", "]")); + + + System.out.println(listToString); + } + +} diff --git a/test1.txt b/test1.txt new file mode 100644 index 0000000..5852f44 --- /dev/null +++ b/test1.txt @@ -0,0 +1 @@ +Initial commit