aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/java/lambda-this-capture/com/example/Lambda.java
blob: 0438f8c37085e65a7253163c8072521df25ab8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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() {
        IntFunction function = value -> value * factor;
        return function.apply(21);
    }
}