From 7925bc6127bdb3e679d25ca1cb4e779827dbdcde Mon Sep 17 00:00:00 2001 From: andreoss Date: Sat, 19 Sep 2020 06:20:43 -0400 Subject: [PATCH] (#1384) Remove extra wrapping --- src/main/java/org/cactoos/map/Grouped.java | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/cactoos/map/Grouped.java b/src/main/java/org/cactoos/map/Grouped.java index 49f1898506..9bbf02c5f0 100644 --- a/src/main/java/org/cactoos/map/Grouped.java +++ b/src/main/java/org/cactoos/map/Grouped.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; -import java.util.stream.Stream; import java.util.stream.StreamSupport; /** @@ -58,18 +57,14 @@ public Grouped( final Function values ) { super( - new MapOf<>( - () -> { - final Stream stream = StreamSupport.stream( - list.spliterator(), false - ); - return stream.collect( - Collectors.groupingBy( - keys, - Collectors.mapping(values, Collectors.toList()) - ) - ); - }) + StreamSupport.stream( + list.spliterator(), false + ).collect( + Collectors.groupingBy( + keys, + Collectors.mapping(values, Collectors.toList()) + ) + ) ); } }