mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 02:14:44 +00:00
[jdk16] Suddenly, Stream has a default method toList :-)
This commit is contained in:
1 parent
251b7541b7
commit
334167bd22
3 files changed
+6
-6
No files matched your search
@@ -16,7 +16,7 @@ class ExtensionMethodFunctional {
|
||||
test.consume(s -> System.out.println("1: " + s), s -> System.out.println("2: " + s));
|
||||
test.consume(System.out::println, System.out::println);
|
||||
|
||||
Stream.of("a", "b", "c").map(String::toUpperCase).toList();
|
||||
Stream.of("a", "b", "c").map(String::toUpperCase).toList1();
|
||||
List<Integer> i2 = Stream.of("a", "b", "c").map(String::toUpperCase).toList2();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class ExtensionMethodFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> List<T> toList(Stream<T> stream) {
|
||||
public static <T> List<T> toList1(Stream<T> stream) {
|
||||
return (List<T>) stream.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user