1
2
3
4
5
6
7
8
9
10
11
12 package com.puppycrawl.tools.checkstyle.grammar.java8;
13 import java.util.Arrays;
14 import java.util.List;
15 import java.util.function.Function;
16 import java.util.function.Supplier;
17
18
19 public class InputMethodReferences<T> extends ParentClass
20 {
21
22 public void main(String[] args) {
23
24 List<Integer> numbers = Arrays.asList(1,2,3,4,5,6);
25
26 numbers.forEach(String.CASE_INSENSITIVE_ORDER::equals);
27 InputMethodReferences tl = new InputMethodReferences();
28
29 String roster = new String();
30 Supplier<InputMethodReferences> supplier = InputMethodReferences<String>::new;
31
32 numbers.forEach(this::println);
33
34 numbers.forEach(super::println);
35 Supplier<InputMethodReferences2> supplier2 = InputMethodReferences2::new;
36 Supplier<InputMethodReferences2> suppl = InputMethodReferences2::<Integer> new;
37 Function<Integer, String[]> messageArrayFactory = String[]::new;
38
39 }
40 }
41
42 class ParentClass
43 {
44
45 public String println(Integer i)
46 {
47 return null;
48 }
49 }