summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java')
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java
new file mode 100644
index 000000000000..e3e2ad0e5d4d
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/lambda2methodReference/afterCollapseToBeInferredTypeArgs.java
@@ -0,0 +1,29 @@
+// "Replace lambda with method reference" "true"
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+class Box<T>
+{
+ public Box(T value)
+ {
+ this._value = value;
+ }
+
+ private final T _value;
+
+ public T getValue()
+ {
+ return this._value;
+ }
+
+ {
+ List<Box<String>> l1 = new ArrayList<>();
+ l1.add(new Box<>("Foo"));
+ l1.add(new Box<>("Bar"));
+
+ List<String> l3 = l1.stream()
+ .map(Box::getValue)
+ .collect(Collectors.toList());
+ }
+} \ No newline at end of file