• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import java.util.List;
2import java.util.function.BiFunction;
3
4@FunctionalInterface
5public interface Lambda {
6	String process(String value);
7}
8
9public interface Processor {
10	void process(String value);
11}
12
13public class Agenda {
14
15	Lambda functional = p -> p.toLowerCase();
16
17    private List<String> persons;
18
19    public void lambdaMap(String personName) {
20        return persons.stream().map(p -> p.toLowerCase());
21    }
22
23    public void lambdaMap2(){
24        return persons.stream().map(p -> p.codePoints());
25    }
26
27    public void reduce(){
28        List<Integer> a;
29        return a.stream().reduce((x,y) -> x * y);
30    }
31
32    double test(BiFunction<Integer,List,String> func){
33        return 0;
34    }
35
36    public void print(String value) {
37        return process(value, v -> System.out.println(v));
38    }
39
40    private void process(String value, Processor a) {
41        a.process(value);
42    }
43
44    public double bifunc(){
45        return test((x,y) -> String.valueOf(func(x,y)));
46    }
47
48    int func(int a, List b){
49        return 1;
50    }
51
52    public void testFunctionalVar() {
53    	Lambda a = p -> p.toLowerCase();
54    }
55
56}
57