aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/ExtensionMethodFunctional.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/after-delombok/ExtensionMethodFunctional.java')
-rw-r--r--test/transform/resource/after-delombok/ExtensionMethodFunctional.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/transform/resource/after-delombok/ExtensionMethodFunctional.java b/test/transform/resource/after-delombok/ExtensionMethodFunctional.java
index bd301543..fb58eb91 100644
--- a/test/transform/resource/after-delombok/ExtensionMethodFunctional.java
+++ b/test/transform/resource/after-delombok/ExtensionMethodFunctional.java
@@ -1,5 +1,8 @@
-import java.util.function.Function;
import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
class ExtensionMethodFunctional {
public void test() {
@@ -7,6 +10,8 @@ class ExtensionMethodFunctional {
test = ExtensionMethodFunctional.Extensions.map(test, s -> ExtensionMethodFunctional.Extensions.reverse(s));
ExtensionMethodFunctional.Extensions.consume(test, s -> System.out.println("1: " + s), s -> System.out.println("2: " + s));
ExtensionMethodFunctional.Extensions.consume(test, System.out::println, System.out::println);
+ ExtensionMethodFunctional.Extensions.toList(Stream.of("a", "b", "c").map(String::toUpperCase));
+ List<Integer> i2 = ExtensionMethodFunctional.Extensions.toList2(Stream.of("a", "b", "c").map(String::toUpperCase));
}
static class Extensions {
@@ -24,5 +29,13 @@ class ExtensionMethodFunctional {
consumer[i].accept(o);
}
}
+
+ public static <T> List<T> toList(Stream<T> stream) {
+ return (List<T>) stream.collect(Collectors.toList());
+ }
+
+ public static <T, U> List<U> toList2(Stream<T> stream) {
+ return null;
+ }
}
}