aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/resources')
-rw-r--r--src/test/resources/java/lambda-this-capture/com/example/Lambda.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/resources/java/lambda-this-capture/com/example/Lambda.java b/src/test/resources/java/lambda-this-capture/com/example/Lambda.java
new file mode 100644
index 0000000..b4aadbf
--- /dev/null
+++ b/src/test/resources/java/lambda-this-capture/com/example/Lambda.java
@@ -0,0 +1,20 @@
+package com.example;
+
+import java.util.function.Function;
+
+public class Lambda {
+ public static int value(int factor) {
+ return new Lambda(factor).run();
+ }
+
+ private final int factor;
+
+ private Lambda(int factor) {
+ this.factor = factor;
+ }
+
+ private int run() {
+ Function<Integer, Integer> function = value -> value * factor;
+ return function.apply(21);
+ }
+}