interface I {} interface J {} interface K extends I {} interface L extends I, J {} class X { static A choose(A x, A y){ return (x.hash() < y.hash()) ? x : y; } static void test(K k, L l){ I i = choose(k,l); // ok } }