class Test <T> { } class I extends Test<String>{ void foo(String t) { } } class Usage { void bar() { new Test<Integer>().foo(1); } }