1 package g5.m.ref;
2 
3 import g5.m.def.*;
4 
5 public class RefMultiple {
6 	// Test methods calls
test()7 	void test() {
8 		Multiple<Object, Exception, RuntimeException> gm = new Multiple<Object, Exception, RuntimeException>();
9 		// Test reference to a standard method
10 		gm.standard(new Object(), new Exception(), new RuntimeException());
11 		// Test reference to a generic method
12 		gm.<Object, Exception, RuntimeException>generic(new Object(), new Exception(), new RuntimeException());
13 		// Test reference to a method returning a parameterized type
14 		gm = gm.returnParamType();
15 		// Test reference to a method with parameterized type arguments
16 		gm.paramTypesArgs(new Single<Object>(), new Single<Exception>(), new Single<RuntimeException>(), gm);
17 		// Test reference to a generic method returning a param type with param type parameters (=full)
18 		gm = gm.<Object, Exception, RuntimeException>complete(new Object(), new Exception(), new RuntimeException(), gm);
19 	}
20 	// Test methods calls to a generic parameterized with ?
testUnbound()21 	void testUnbound() {
22 		Multiple<?,?,?> gm = new Multiple();
23 		gm.paramTypesArgs(new Single<Object>(), new Single<Object>(), new Single<Object>(), gm);
24 		gm = gm.returnParamType();
25 	}
26 	// Test methods calls to a generic parameterized with ? extends Throwable
testExtends()27 	void testExtends() {
28 		Multiple<Object, ? extends Throwable, ? extends Exception> gm = new Multiple<Object, Exception, RuntimeException>();
29 		gm.<Object, RuntimeException, RuntimeException>generic(new Object(), new RuntimeException(), new RuntimeException());
30 		gm.paramTypesArgs(new Single<Object>(), new Single<Throwable>(), new Single<Exception>(), gm);
31 		gm = gm.returnParamType();
32 		gm = gm.<Object, RuntimeException, RuntimeException>complete(new Object(), new RuntimeException(), new RuntimeException(), gm);
33 	}
34 	// Test methods calls to a generic parameterized with ? super RuntimeException
testSuper()35 	void testSuper() {
36 		Multiple<Object, ? super RuntimeException, ? super IllegalMonitorStateException> gm = new Multiple<Object, Exception, RuntimeException>();
37 		gm.<Object, RuntimeException, IllegalMonitorStateException>generic(new Object(), new RuntimeException(), new IllegalMonitorStateException());
38 		gm.paramTypesArgs(new Single<Object>(), new Single<RuntimeException>(), new Single<RuntimeException>(), gm);
39 		gm = gm.returnParamType();
40 		gm = gm.<Object, RuntimeException, IllegalMonitorStateException>complete(new Object(), new RuntimeException(), new IllegalMonitorStateException(), gm);
41 	}
42 }
43