class Gen<X extends Integer> { public doSomething(X num){ } } class Test{ public void test(x){ x.doSomething(""); } }