1 package com.puppycrawl.tools.checkstyle.grammar.java8; 2 3 import java.lang.annotation.ElementType; 4 import java.lang.annotation.Target; 5 import java.util.List; 6 import java.util.function.Supplier; 7 8 9 public class InputMethodReferences7 { 10 interface LambdaInt { 11 <S, T> void m(S p1, T p2); 12 } 13 14 interface MyFunctionalInterface { 15 void invokeMethodReference(); 16 } 17 18 static class LambdaImpl implements LambdaInt { 19 <S, T> LambdaImpl(S p1, T p2) { 20 } 21 22 public <S, T> void m(S p1, T p2) { 23 } 24 } 25 26 public void m() { 27 } 28 29 public void main(String[] args) { 30 MyFunctionalInterface fi = new InputMethodReferences7()::<Integer, String, Long> m; 31 LambdaInt li = LambdaImpl::<@TA Object, @TB Object> new; 32 Supplier s = Bar::<String> m; 33 li = li::<@TA Object, @TB Object> m; 34 s = Bar::<List<String>> m; 35 s = Bar::<List<List<?>>> m; 36 } 37 } 38 39 class Bar<T> { 40 static Object m() { 41 return null; 42 } 43 } 44 45 @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) 46 @interface TA { 47 } 48 49 @Target({ ElementType.TYPE_USE, ElementType.TYPE_PARAMETER }) 50 @interface TB { 51 }