aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/grammars/java8/InputMethodReferences.java
blob: f654b85cdbea12cb11f8305ca64076022f399710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//Compilable with Java8
package com.puppycrawl.tools.checkstyle.grammars.java8;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;

public class InputMethodReferences<T> extends ParentClass
{

    public void main(String[] args) {
		
		List<Integer> numbers = Arrays.asList(1,2,3,4,5,6);
		
		numbers.forEach(String.CASE_INSENSITIVE_ORDER::equals);
		InputMethodReferences tl = new InputMethodReferences();

		String roster = new String();
		Supplier<InputMethodReferences> supplier = InputMethodReferences<String>::new;

		numbers.forEach(this::println);
		
		numbers.forEach(super::println);
        Supplier<InputMethodReferences2> supplier2 = InputMethodReferences2::new;
        Supplier<InputMethodReferences2> suppl = InputMethodReferences2::<Integer> new;
        Function<Integer, String[]> messageArrayFactory = String[]::new;
		
	}
}

class ParentClass
{

    public String println(Integer i)
    {
        return null;
    }
}